github.com/dahs81/otto@v0.2.1-0.20160126165905-6400716cf085/command/help.go (about) 1 package command 2 3 import ( 4 "strings" 5 ) 6 7 // HelpCommand is not a real command. It just shows help output for 8 // people expecting `otto help` to work. 9 type HelpCommand struct { 10 Meta 11 } 12 13 func (c *HelpCommand) Run(args []string) int { 14 c.Ui.Error(strings.TrimSpace(helpOutput)) 15 return 1 16 } 17 18 func (c *HelpCommand) Synopsis() string { 19 return "Not a real command." 20 } 21 22 func (c *HelpCommand) Help() string { 23 return "Not a real command." 24 } 25 26 const helpOutput = ` 27 Otto doesn't use "otto help" for subcommand help! 28 29 For a list of all available top level subcommands, run "otto -h". 30 31 For individual commands use the "-h" flag to get help. For example: 32 "otto status -h" will show you how to use the status command. 33 34 For commands that take subcommands such as "dev", use the "help" subcommand 35 to get a full listing of availabile subcommands. For example: "otto dev help". 36 `