key: encrypt fail when missing key or password.

This commit is contained in:
fiatjaf
2026-09-29 18:50:13 -03:00
parent 5856ace71b
commit 98f44cc1d1
+3
View File
@@ -142,6 +142,9 @@ var encryptKey = &cli.Command{
var password string
switch c.Args().Len() {
case 1:
if !isPiped() {
return fmt.Errorf("no password given or key piped on stdin")
}
password = c.Args().Get(0)
case 2:
keys = append(keys, c.Args().Get(0))