Skip to content

Commit

Permalink
cmd/age: improve a couple error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
FiloSottile committed Mar 10, 2021
1 parent f3fdc33 commit 53f0ebd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cmd/age/age.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,8 @@ func main() {
}

if flag.NArg() > 1 {
logFatalf("Error: too many arguments.\n" +
"age accepts a single optional argument for the input file.")
logFatalf("Error: too many arguments: %q.\n"+
"Note that the input file must be specified after all flags.", flag.Args())
}
switch {
case decryptFlag:
Expand Down
4 changes: 4 additions & 0 deletions cmd/age/parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ func parseRecipient(arg string) (age.Recipient, error) {
return age.ParseX25519Recipient(arg)
case strings.HasPrefix(arg, "ssh-"):
return agessh.ParseRecipient(arg)
case strings.HasPrefix(arg, "github:"):
name := strings.TrimPrefix(arg, "github:")
return nil, fmt.Errorf(`"github:" recipients were removed from the design.`+"\n"+
"Instead, use recipient files like\n\n curl -O https://github.com/%s.keys\n age -R %s.keys\n\n", name, name)
}

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

1 comment on commit 53f0ebd

@Fastidious
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How to build version 1RC? I tried brew, but no update, and I built it following the README, and got the same I have (beta 6?).

Please sign in to comment.