diff options
| author | Levi Durfee <levi.durfee@gmail.com> | 2026-01-08 18:21:45 -0500 |
|---|---|---|
| committer | Levi Durfee <levi.durfee@gmail.com> | 2026-01-08 18:22:55 -0500 |
| commit | 6b24f73fb3c71062321aa1f7f9694b42b7299a6a (patch) | |
| tree | 494ea61efb3a924f60e2ebe9fc50e0b92aedd4be /cmd/goaes/commands | |
| parent | 496c557b041ae17557c99e8a0092e21431a2242d (diff) | |
Simplify decrypt command
Diffstat (limited to 'cmd/goaes/commands')
| -rw-r--r-- | cmd/goaes/commands/decrypt.go | 12 |
1 files changed, 10 insertions, 2 deletions
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) |
