From 53f0ebda67901013bddf1a6bd59c946574c87d0b Mon Sep 17 00:00:00 2001 From: Filippo Valsorda Date: Wed, 10 Mar 2021 11:26:45 +0100 Subject: [PATCH] cmd/age: improve a couple error messages --- cmd/age/age.go | 4 ++-- cmd/age/parse.go | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/cmd/age/age.go b/cmd/age/age.go index 9a3645b2..a060aee1 100644 --- a/cmd/age/age.go +++ b/cmd/age/age.go @@ -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: diff --git a/cmd/age/parse.go b/cmd/age/parse.go index 96df4f0f..9a7faa17 100644 --- a/cmd/age/parse.go +++ b/cmd/age/parse.go @@ -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)