diff options
Diffstat (limited to 'cmd/goaes/commands/encrypt.go')
| -rw-r--r-- | cmd/goaes/commands/encrypt.go | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/cmd/goaes/commands/encrypt.go b/cmd/goaes/commands/encrypt.go index df707cb..223502b 100644 --- a/cmd/goaes/commands/encrypt.go +++ b/cmd/goaes/commands/encrypt.go @@ -12,8 +12,12 @@ import ( ) func Encrypt(ctx context.Context, cmd *cli.Command) error { - source := cmd.String("source") - destination := cmd.String("destination") + source := cmd.StringArg("source") + destination := cmd.StringArg("destination") + + if destination == "" { + destination = source + ".goaes" + } source = filepath.Clean(source) plaintext, err := os.ReadFile(source) |
