From 6b24f73fb3c71062321aa1f7f9694b42b7299a6a Mon Sep 17 00:00:00 2001 From: Levi Durfee Date: Thu, 8 Jan 2026 18:21:45 -0500 Subject: Simplify decrypt command --- cmd/goaes/commands/decrypt.go | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'cmd/goaes/commands/decrypt.go') diff --git a/cmd/goaes/commands/decrypt.go b/cmd/goaes/commands/decrypt.go index 9168a00..1fcd83e 100644 --- a/cmd/goaes/commands/decrypt.go +++ b/cmd/goaes/commands/decrypt.go @@ -12,8 +12,16 @@ import ( ) func Decrypt(ctx context.Context, cmd *cli.Command) error { - source := cmd.String("source") - destination := cmd.String("destination") + source := cmd.StringArg("source") + destination := cmd.StringArg("destination") + + if source == "" { + return cli.Exit("missing source", 2) + } + + if destination == "" { + return cli.Exit("missing destination", 2) + } source = filepath.Clean(source) file, err := os.Open(source) -- cgit v1.2.3