cmd := cmdline.New("myapp", "A simple command line tool") cmd.SetForkCmd("start", "Start the server") cmd.Parse(os.Args)
cmd := cmdline.New("myapp", "A simple command line tool") cmd.SetForkCmd("stop", "Stop the server") cmd.SetForkCmd("restart", "Restart the server") cmd.SetForkCmd("reload", "Reload the server configuration") cmd.Parse(os.Args)In this example, three different commands are defined ("stop", "restart", and "reload"). Each command has a corresponding description that will be displayed when the user requests help. The Parse method is used to read the command-line arguments and execute the appropriate command. Package library: github.com.keybase.client.go.libcmdline