Skip to content

Commit

Permalink
Merge pull request #1016 from urfave/uncomment
Browse files Browse the repository at this point in the history
Uncomment manual sections
  • Loading branch information
coilysiren committed Dec 26, 2019
2 parents c7f0414 + 9000236 commit a56a0b9
Showing 1 changed file with 28 additions and 32 deletions.
60 changes: 28 additions & 32 deletions docs/v2/manual.md
Original file line number Diff line number Diff line change
Expand Up @@ -1460,15 +1460,13 @@ func main() {
cli.ShowVersion(c)

fmt.Printf("%#v\n", c.App.Command("doo"))
// // uncomment when https://github.com/urfave/cli/pull/1014 is released
// if c.Bool("infinite") {
// c.App.Run([]string{"app", "doo", "wop"})
// }

// // uncomment when https://github.com/urfave/cli/pull/1014 is released
// if c.Bool("forevar") {
// c.App.RunAsSubcommand(c)
// }
if c.Bool("infinite") {
c.App.Run([]string{"app", "doo", "wop"})
}

if c.Bool("forevar") {
c.App.RunAsSubcommand(c)
}
c.App.Setup()
fmt.Printf("%#v\n", c.App.VisibleCategories())
fmt.Printf("%#v\n", c.App.VisibleCommands())
Expand All @@ -1484,29 +1482,27 @@ func main() {
set := flag.NewFlagSet("contrive", 0)
nc := cli.NewContext(c.App, set, c)

// // uncomment when https://github.com/urfave/cli/pull/1014 is released
// fmt.Printf("%#v\n", nc.Args())
// fmt.Printf("%#v\n", nc.Bool("nope"))
// fmt.Printf("%#v\n", !nc.Bool("nerp"))
// fmt.Printf("%#v\n", nc.Duration("howlong"))
// fmt.Printf("%#v\n", nc.Float64("hay"))
// fmt.Printf("%#v\n", nc.Generic("bloop"))
// fmt.Printf("%#v\n", nc.Int64("bonk"))
// fmt.Printf("%#v\n", nc.Int64Slice("burnks"))
// fmt.Printf("%#v\n", nc.Int("bips"))
// fmt.Printf("%#v\n", nc.IntSlice("blups"))
// fmt.Printf("%#v\n", nc.String("snurt"))
// fmt.Printf("%#v\n", nc.StringSlice("snurkles"))
// fmt.Printf("%#v\n", nc.Uint("flub"))
// fmt.Printf("%#v\n", nc.Uint64("florb"))

// // uncomment when https://github.com/urfave/cli/pull/1014 is released
// fmt.Printf("%#v\n", nc.FlagNames())
// fmt.Printf("%#v\n", nc.IsSet("wat"))
// fmt.Printf("%#v\n", nc.Set("wat", "nope"))
// fmt.Printf("%#v\n", nc.NArg())
// fmt.Printf("%#v\n", nc.NumFlags())
// fmt.Printf("%#v\n", nc.Lineage()[1])
fmt.Printf("%#v\n", nc.Args())
fmt.Printf("%#v\n", nc.Bool("nope"))
fmt.Printf("%#v\n", !nc.Bool("nerp"))
fmt.Printf("%#v\n", nc.Duration("howlong"))
fmt.Printf("%#v\n", nc.Float64("hay"))
fmt.Printf("%#v\n", nc.Generic("bloop"))
fmt.Printf("%#v\n", nc.Int64("bonk"))
fmt.Printf("%#v\n", nc.Int64Slice("burnks"))
fmt.Printf("%#v\n", nc.Int("bips"))
fmt.Printf("%#v\n", nc.IntSlice("blups"))
fmt.Printf("%#v\n", nc.String("snurt"))
fmt.Printf("%#v\n", nc.StringSlice("snurkles"))
fmt.Printf("%#v\n", nc.Uint("flub"))
fmt.Printf("%#v\n", nc.Uint64("florb"))

fmt.Printf("%#v\n", nc.FlagNames())
fmt.Printf("%#v\n", nc.IsSet("wat"))
fmt.Printf("%#v\n", nc.Set("wat", "nope"))
fmt.Printf("%#v\n", nc.NArg())
fmt.Printf("%#v\n", nc.NumFlags())
fmt.Printf("%#v\n", nc.Lineage()[1])
nc.Set("wat", "also-nope")

ec := cli.Exit("ohwell", 86)
Expand Down

0 comments on commit a56a0b9

Please sign in to comment.