| 1 |
// Package help contains the help for the store command. |
| 2 |
package help |
| 3 |
|
| 4 |
import ( |
| 5 |
"fmt" |
| 6 |
"io" |
| 7 |
"os" |
| 8 |
"strings" |
| 9 |
) |
| 10 |
|
| 11 |
// Command displays help for command-line sub-commands. |
| 12 |
type Command struct { |
| 13 |
Stdout io.Writer |
| 14 |
} |
| 15 |
|
| 16 |
// NewCommand returns a new instance of Command. |
| 17 |
func NewCommand() *Command { |
| 18 |
return &Command{ |
| 19 |
Stdout: os.Stdout, |
| 20 |
} |
| 21 |
} |
| 22 |
|
| 23 |
// Run executes the command. |
| 24 |
func (cmd *Command) Run(args ...string) error { |
| 25 |
fmt.Fprintln(cmd.Stdout, strings.TrimSpace(usage)) |
| 26 |
return nil |
| 27 |
} |
| 28 |
|
| 29 |
const usage = ` |
| 30 |
Usage: store [[command] [arguments]] |
| 31 |
|
| 32 |
The commands are: |
| 33 |
|
| 34 |
query queries data. |
| 35 |
help display this help message |
| 36 |
|
| 37 |
"help" is the default command. |
| 38 |
|
| 39 |
Use "store [command] -help" for more information about a command. |
| 40 |
` |