Merge pull request #823 from xordspar0/master

Make the exit code example more clear
main
Lynn Cyrin (they/them) 5 years ago committed by GitHub
commit 26945c58ed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -902,14 +902,14 @@ import (
func main() {
app := cli.NewApp()
app.Flags = []cli.Flag{
cli.BoolTFlag{
cli.BoolFlag{
Name: "ginger-crouton",
Usage: "is it in the soup?",
Usage: "Add ginger croutons to the soup",
},
}
app.Action = func(ctx *cli.Context) error {
if !ctx.Bool("ginger-crouton") {
return cli.NewExitError("it is not in the soup", 86)
return cli.NewExitError("Ginger croutons are not in the soup", 86)
}
return nil
}

Loading…
Cancel
Save