WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit 53f0ebd

Browse files
committed
cmd/age: improve a couple error messages
1 parent f3fdc33 commit 53f0ebd

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

cmd/age/age.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,8 @@ func main() {
126126
}
127127

128128
if flag.NArg() > 1 {
129-
logFatalf("Error: too many arguments.\n" +
130-
"age accepts a single optional argument for the input file.")
129+
logFatalf("Error: too many arguments: %q.\n"+
130+
"Note that the input file must be specified after all flags.", flag.Args())
131131
}
132132
switch {
133133
case decryptFlag:

cmd/age/parse.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ func parseRecipient(arg string) (age.Recipient, error) {
2828
return age.ParseX25519Recipient(arg)
2929
case strings.HasPrefix(arg, "ssh-"):
3030
return agessh.ParseRecipient(arg)
31+
case strings.HasPrefix(arg, "github:"):
32+
name := strings.TrimPrefix(arg, "github:")
33+
return nil, fmt.Errorf(`"github:" recipients were removed from the design.`+"\n"+
34+
"Instead, use recipient files like\n\n curl -O https://github.com/%s.keys\n age -R %s.keys\n\n", name, name)
3135
}
3236

3337
return nil, fmt.Errorf("unknown recipient type: %q", arg)

0 commit comments

Comments
 (0)