diff --git a/README.md b/README.md index 341194a..020c0e3 100644 --- a/README.md +++ b/README.md @@ -103,7 +103,7 @@ itself uses: ## Building from source -This project uses [Go modules](https://go.dev/blog/using-go-modules) and requires Go 1.26+. +This project uses [Go modules](https://go.dev/blog/using-go-modules) and requires Go 1.26.5+. ```bash go mod download diff --git a/go.mod b/go.mod index b5de66c..3bfd271 100644 --- a/go.mod +++ b/go.mod @@ -1,8 +1,6 @@ module env-aws-params -go 1.26 - -toolchain go1.26.5 +go 1.26.5 require ( github.com/aws/aws-sdk-go-v2 v1.41.7 diff --git a/main.go b/main.go index f9ef265..ee837c1 100644 --- a/main.go +++ b/main.go @@ -29,6 +29,11 @@ func main() { Flags: cliFlags(), Action: action, StopOnNthArg: &stopOnFirstArg, + // Flag parsing errors never reach action, so they are mapped to + // the documented usage-error exit code here. + OnUsageError: func(_ context.Context, _ *cli.Command, err error, _ bool) error { + return cli.Exit(errorPrefix(err), 125) + }, } if err := cmd.Run(context.Background(), os.Args); err != nil { log.Fatal(err)