Documentation
¶
Overview ¶
[urfave-cli](https://github.com/urfave/cli) is a popular CLI package. In this example we will show how to use it to create flags, sub commands and act on them. godoc: [https://godoc.org/github.com/urfave/cli](https://godoc.org/github.com/urfave/cli)
urfave-cli example #1 See how different App properties show up in -h
urfave-cli example #2 Accessing non-flag arguments with c.Args()
urfave-cli example #3 Sets flags host and port then prints host:port.
urfave-cli example #4 Using sub commands to hack the planet! Usually when using subcommands we pass/read another non-flag argument
urfave-cli example #5 Showing subcommand categories and using cli.Context passed to Action func. This time we are using the same function for Action of all sub commands and then grabbing the subcommand in the function.