Style cleanups of full API example in README

This commit is contained in:
Dan Buch 2016-06-10 13:00:33 -04:00
parent d5abb165ee
commit 8ea4b523d2
No known key found for this signature in database
GPG Key ID: FAEF12936DD3E3EC

View File

@ -1112,8 +1112,8 @@ func main() {
} }
app.Flags = []cli.Flag{ app.Flags = []cli.Flag{
&cli.BoolFlag{Name: "fancy"}, &cli.BoolFlag{Name: "fancy"},
&cli.BoolFlag{Value: true,Name: "fancier"}, &cli.BoolFlag{Value: true, Name: "fancier"},
&cli.StringFlag{Name: "dance-move, d"}, &cli.StringFlag{Name: "dance-move", Aliases: []string{"d"}},
} }
app.EnableBashCompletion = true app.EnableBashCompletion = true
app.HideHelp = false app.HideHelp = false
@ -1194,17 +1194,7 @@ func main() {
fmt.Printf("%#v\n", nc.IntSlice("blups")) fmt.Printf("%#v\n", nc.IntSlice("blups"))
fmt.Printf("%#v\n", nc.String("snurt")) fmt.Printf("%#v\n", nc.String("snurt"))
fmt.Printf("%#v\n", nc.StringSlice("snurkles")) fmt.Printf("%#v\n", nc.StringSlice("snurkles"))
fmt.Printf("%#v\n", nc.Bool("global-nope"))
fmt.Printf("%#v\n", !nc.Bool("global-nerp"))
fmt.Printf("%#v\n", nc.Duration("global-howlong"))
fmt.Printf("%#v\n", nc.Float64("global-hay"))
fmt.Printf("%#v\n", nc.Generic("global-bloop"))
fmt.Printf("%#v\n", nc.Int("global-bips"))
fmt.Printf("%#v\n", nc.IntSlice("global-blups"))
fmt.Printf("%#v\n", nc.String("global-snurt"))
fmt.Printf("%#v\n", nc.StringSlice("global-snurkles"))
fmt.Printf("%#v\n", nc.FlagNames())
fmt.Printf("%#v\n", nc.FlagNames()) fmt.Printf("%#v\n", nc.FlagNames())
fmt.Printf("%#v\n", nc.IsSet("wat")) fmt.Printf("%#v\n", nc.IsSet("wat"))
fmt.Printf("%#v\n", nc.Set("wat", "nope")) fmt.Printf("%#v\n", nc.Set("wat", "nope"))