From ef4480fe6d3bc1aee7d8718034362e7b09e714a3 Mon Sep 17 00:00:00 2001 From: Juan Batiz-Benet Date: Wed, 12 Nov 2014 03:13:17 -0800 Subject: [PATCH] cmds/config: better help text --- commands/cli/helptext.go | 2 ++ core/commands2/config.go | 37 +++++++++++++++++++++++++++---------- 2 files changed, 29 insertions(+), 10 deletions(-) diff --git a/commands/cli/helptext.go b/commands/cli/helptext.go index e27a27bf9..9dfa8bf37 100644 --- a/commands/cli/helptext.go +++ b/commands/cli/helptext.go @@ -98,6 +98,8 @@ const shortHelpFormat = `USAGE: {{.Indent}}{{template "usage" .}} {{if .Synopsis}} +SYNOPSIS + {{.Synopsis}} {{end}}{{if .Description}} {{.Description}} diff --git a/core/commands2/config.go b/core/commands2/config.go index 40fb3cf91..ab6706594 100644 --- a/core/commands2/config.go +++ b/core/commands2/config.go @@ -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 - Get value of +ipfs config - Set value of to +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\")"),