示例#1
0
func ExampleF_PrintUsage() {

	// Init cli
	var cli = gocli.Cli{
		Name:        "test",
		Version:     "1.0.0",
		Description: "test desc",
		Commands: map[string]string{
			"cmd": "Test command",
		},
	}
	cli.Init()

	cli.PrintUsage()
	// Output:
	// Usage: test [OPTIONS] COMMAND [arg...]
	//
	// test desc
	//
	// Options:
	//   --arg         : Arg flag (default "test")
	//   -h, --help    : Display usage
	//   -v, --version : Display version information
	//
	// Commands:
	//   cmd           : Test command
}