Merge pull request #823 from xordspar0/master
Make the exit code example more clear
This commit is contained in:
commit
26945c58ed
@ -902,14 +902,14 @@ import (
|
|||||||
func main() {
|
func main() {
|
||||||
app := cli.NewApp()
|
app := cli.NewApp()
|
||||||
app.Flags = []cli.Flag{
|
app.Flags = []cli.Flag{
|
||||||
cli.BoolTFlag{
|
cli.BoolFlag{
|
||||||
Name: "ginger-crouton",
|
Name: "ginger-crouton",
|
||||||
Usage: "is it in the soup?",
|
Usage: "Add ginger croutons to the soup",
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
app.Action = func(ctx *cli.Context) error {
|
app.Action = func(ctx *cli.Context) error {
|
||||||
if !ctx.Bool("ginger-crouton") {
|
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
|
return nil
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user