@cryptotaxi247 / kubo / commits / ef4480fe6

cmds/config: better help text

Juan Batiz-Benet committed Nov 12, 2014 at 03:13 UTC ef4480fe6d3bc1aee7d8718034362e7b09e714a3
2 files changed +25 -6
commands/cli/helptext.go
+2
@@ -98,6 +98,8 @@ const shortHelpFormat = `USAGE:
98
99 {{.Indent}}{{template "usage" .}}
100 {{if .Synopsis}}
101 +SYNOPSIS
102 +
103 {{.Synopsis}}
104 {{end}}{{if .Description}}
105 {{.Description}}
core/commands2/config.go
+23 -6
@@ -21,17 +21,34 @@ type ConfigField struct {
21 }
22
23 var configCmd = &cmds.Command{
24 - Description: "Get/set IPFS config values",
25 - Help: `Examples:
24 + Helptext: cmds.HelpText{
25 + Tagline: "get and set IPFS config values",
26 + Synopsis: `
27 +ipfs config <key> - Get value of <key>
28 +ipfs config <key> <value> - Set value of <key> to <value>
29 +ipfs config --show - Show config file
30 +ipfs config --edit - Edit config file in $EDITOR
31 +`,
32 + ShortDescription: `
33 +ipfs config controls configuration variables. It works like 'git config'.
34 +The configuration values are stored in a config file inside your IPFS
35 +repository.`,
36 + LongDescription: `
37 +ipfs config controls configuration variables. It works
38 +much like 'git config'. The configuration values are stored in a config
39 +file inside your IPFS repository.
40 +
41 +EXAMPLES:
42
27 - Get the value of the 'datastore.path' key:
43 +Get the value of the 'datastore.path' key:
44
29 - ipfs config datastore.path
45 + ipfs config datastore.path
46
31 - Set the value of the 'datastore.path' key:
47 +Set the value of the 'datastore.path' key:
48
33 - ipfs config datastore.path ~/.go-ipfs/datastore
49 + ipfs config datastore.path ~/.go-ipfs/datastore
50 `,
51 + },
52
53 Arguments: []cmds.Argument{
54 cmds.StringArg("key", true, false, "The key of the config entry (e.g. \"Addresses.API\")"),