Debian Codegraph @

cmd/influxd/help/help.go

raw
1 // Package help is the help subcommand of the influxd 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 Configure and start an InfluxDB server.
31
32 Usage: influxd [[command] [arguments]]
33
34 The commands are:
35
36 backup downloads a snapshot of a data node and saves it to disk
37 config display the default configuration
38 help display this help message
39 restore uses a snapshot of a data node to rebuild a cluster
40 run run node with existing configuration
41 version displays the InfluxDB version
42
43 "run" is the default command.
44
45 Use "influxd [command] -help" for more information about a command.
46 `