cmds/config: better help text

This commit is contained in:
Juan Batiz-Benet 2014-11-12 03:13:17 -08:00
parent fc7c199d6a
commit ef4480fe6d
2 changed files with 29 additions and 10 deletions

View File

@ -98,6 +98,8 @@ const shortHelpFormat = `USAGE:
{{.Indent}}{{template "usage" .}}
{{if .Synopsis}}
SYNOPSIS
{{.Synopsis}}
{{end}}{{if .Description}}
{{.Description}}

View File

@ -21,17 +21,34 @@ type ConfigField struct {
}
var configCmd = &cmds.Command{
Description: "Get/set IPFS config values",
Help: `Examples:
Get the value of the 'datastore.path' key:
ipfs config datastore.path
Set the value of the 'datastore.path' key:
ipfs config datastore.path ~/.go-ipfs/datastore
Helptext: cmds.HelpText{
Tagline: "get and set IPFS config values",
Synopsis: `
ipfs config <key> - Get value of <key>
ipfs config <key> <value> - Set value of <key> to <value>
ipfs config --show - Show config file
ipfs config --edit - Edit config file in $EDITOR
`,
ShortDescription: `
ipfs config controls configuration variables. It works like 'git config'.
The configuration values are stored in a config file inside your IPFS
repository.`,
LongDescription: `
ipfs config controls configuration variables. It works
much like 'git config'. The configuration values are stored in a config
file inside your IPFS repository.
EXAMPLES:
Get the value of the 'datastore.path' key:
ipfs config datastore.path
Set the value of the 'datastore.path' key:
ipfs config datastore.path ~/.go-ipfs/datastore
`,
},
Arguments: []cmds.Argument{
cmds.StringArg("key", true, false, "The key of the config entry (e.g. \"Addresses.API\")"),