summaryrefslogtreecommitdiff
path: root/cmd/goaes/commands/encrypt.go
diff options
context:
space:
mode:
authorLevi Durfee <levi.durfee@gmail.com>2026-01-08 18:14:50 -0500
committerLevi Durfee <levi.durfee@gmail.com>2026-01-08 18:19:26 -0500
commit496c557b041ae17557c99e8a0092e21431a2242d (patch)
tree81a3769dcd822245ae3ac20b05bb4ac510436d43 /cmd/goaes/commands/encrypt.go
parent6bf86ba37918b918cd8bf432757c00f69d35b85f (diff)
Simplify encrypt command
Diffstat (limited to 'cmd/goaes/commands/encrypt.go')
-rw-r--r--cmd/goaes/commands/encrypt.go8
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)