From 496c557b041ae17557c99e8a0092e21431a2242d Mon Sep 17 00:00:00 2001 From: Levi Durfee Date: Thu, 8 Jan 2026 18:14:50 -0500 Subject: Simplify encrypt command --- cmd/goaes/commands/encrypt.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'cmd/goaes/commands') 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) -- cgit v1.2.3