summaryrefslogtreecommitdiff
path: root/cmd/goaes/commands/decrypt.go
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/goaes/commands/decrypt.go')
-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)