~samwhited/cli

ref: 8da9bdbba125beb76c6f3d3e9be1850cbf634b69 cli/example_help_test.go -rw-r--r-- 558 bytes
8da9bdbbSam Whited cli: remove auto help printing 3 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// Copyright 2017 The Mellium Contributors.
// Use of this source code is governed by the BSD 2-clause license that can be
// found in the LICENSE file.

package cli_test

import (
	"mellium.im/cli"
)

func ExampleHelp() {
	cmds := &cli.Command{
		Usage: "git [options] command",
	}
	cmds.Commands = []*cli.Command{
		commitCmd(nil),
		cli.Help(cmds),
	}
	cmds.Exec("help")

	// Output:
	// Usage: git [options] command
	//
	// Commands:
	//
	//	commit	Records changes to the repository.
	//	help	Print articles and detailed information about subcommands.
}