summaryrefslogtreecommitdiff
path: root/cmd/goaes/commands
diff options
context:
space:
mode:
authorLevi Durfee <levi.durfee@gmail.com>2026-01-08 18:21:45 -0500
committerLevi Durfee <levi.durfee@gmail.com>2026-01-08 18:22:55 -0500
commit6b24f73fb3c71062321aa1f7f9694b42b7299a6a (patch)
tree494ea61efb3a924f60e2ebe9fc50e0b92aedd4be /cmd/goaes/commands
parent496c557b041ae17557c99e8a0092e21431a2242d (diff)
Simplify decrypt command
Diffstat (limited to 'cmd/goaes/commands')
-rw-r--r--cmd/goaes/commands/decrypt.go12
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)