提交 e700b165 作者: Matt Bell 提交者: Juan Batiz-Benet

Ported remaining command helptext to HelpText struct

上级 6597a5f7
...@@ -15,8 +15,11 @@ import ( ...@@ -15,8 +15,11 @@ import (
) )
var daemonCmd = &cmds.Command{ var daemonCmd = &cmds.Command{
Helptext: cmds.HelpText{
Tagline: "run a network-connected ipfs node", // TODO adjust copy
},
Options: []cmds.Option{}, Options: []cmds.Option{},
Help: "run a network-connected ipfs node", // TODO adjust copy
Subcommands: map[string]*cmds.Command{}, Subcommands: map[string]*cmds.Command{},
Run: daemonFunc, Run: daemonFunc,
} }
......
...@@ -15,9 +15,10 @@ import ( ...@@ -15,9 +15,10 @@ import (
) )
var initCmd = &cmds.Command{ var initCmd = &cmds.Command{
Description: "Initializes IPFS config file", Helptext: cmds.HelpText{
Help: `Initializes IPFS configuration files and generates a new keypair. Tagline: "Initializes IPFS config file",
`, ShortDescription: "Initializes IPFS configuration files and generates a new keypair.",
},
Options: []cmds.Option{ Options: []cmds.Option{
cmds.IntOption("bits", "b", "Number of bits to use in the generated RSA private key (defaults to 4096)"), cmds.IntOption("bits", "b", "Number of bits to use in the generated RSA private key (defaults to 4096)"),
......
...@@ -60,7 +60,9 @@ IPFS very quickly. To start, run: ...@@ -60,7 +60,9 @@ IPFS very quickly. To start, run:
} }
var cmdIpfsTourNext = &cmds.Command{ var cmdIpfsTourNext = &cmds.Command{
Description: "Show the next IPFS Tour topic", Helptext: cmds.HelpText{
Tagline: "Show the next IPFS Tour topic",
},
Run: func(req cmds.Request) (interface{}, error) { Run: func(req cmds.Request) (interface{}, error) {
var w bytes.Buffer var w bytes.Buffer
...@@ -90,7 +92,9 @@ var cmdIpfsTourNext = &cmds.Command{ ...@@ -90,7 +92,9 @@ var cmdIpfsTourNext = &cmds.Command{
} }
var cmdIpfsTourRestart = &cmds.Command{ var cmdIpfsTourRestart = &cmds.Command{
Description: "Restart the IPFS Tour", Helptext: cmds.HelpText{
Tagline: "Restart the IPFS Tour",
},
Run: func(req cmds.Request) (interface{}, error) { Run: func(req cmds.Request) (interface{}, error) {
path := req.Context().ConfigRoot path := req.Context().ConfigRoot
...@@ -109,7 +113,9 @@ var cmdIpfsTourRestart = &cmds.Command{ ...@@ -109,7 +113,9 @@ var cmdIpfsTourRestart = &cmds.Command{
} }
var cmdIpfsTourList = &cmds.Command{ var cmdIpfsTourList = &cmds.Command{
Description: "Show a list of IPFS Tour topics", Helptext: cmds.HelpText{
Tagline: "Show a list of IPFS Tour topics",
},
Run: func(req cmds.Request) (interface{}, error) { Run: func(req cmds.Request) (interface{}, error) {
cfg, err := req.Context().GetConfig() cfg, err := req.Context().GetConfig()
......
...@@ -80,9 +80,13 @@ It outputs to stdout, and <key> is a base58 encoded multihash. ...@@ -80,9 +80,13 @@ It outputs to stdout, and <key> is a base58 encoded multihash.
} }
var blockPutCmd = &cmds.Command{ var blockPutCmd = &cmds.Command{
Description: "Stores input as an IPFS block", Helptext: cmds.HelpText{
Help: `ipfs block put is a plumbing command for storing raw ipfs blocks. Tagline: "Stores input as an IPFS block",
It reads from stdin, and <key> is a base58 encoded multihash.`, ShortDescription: `
ipfs block put is a plumbing command for storing raw ipfs blocks.
It reads from stdin, and <key> is a base58 encoded multihash.
`,
},
Arguments: []cmds.Argument{ Arguments: []cmds.Argument{
cmds.FileArg("data", true, false, "The data to be stored as an IPFS block"), cmds.FileArg("data", true, false, "The data to be stored as an IPFS block"),
......
...@@ -116,10 +116,13 @@ Set the value of the 'datastore.path' key: ...@@ -116,10 +116,13 @@ Set the value of the 'datastore.path' key:
} }
var configShowCmd = &cmds.Command{ var configShowCmd = &cmds.Command{
Description: "Outputs the content of the config file", Helptext: cmds.HelpText{
Help: `WARNING: Your private key is stored in the config file, and it will be Tagline: "Outputs the content of the config file",
ShortDescription: `
WARNING: Your private key is stored in the config file, and it will be
included in the output of this command. included in the output of this command.
`, `,
},
Run: func(req cmds.Request) (interface{}, error) { Run: func(req cmds.Request) (interface{}, error) {
filename, err := config.Filename(req.Context().ConfigRoot) filename, err := config.Filename(req.Context().ConfigRoot)
...@@ -132,10 +135,13 @@ included in the output of this command. ...@@ -132,10 +135,13 @@ included in the output of this command.
} }
var configEditCmd = &cmds.Command{ var configEditCmd = &cmds.Command{
Description: "Opens the config file for editing in $EDITOR", Helptext: cmds.HelpText{
Help: `To use 'ipfs config edit', you must have the $EDITOR environment Tagline: "Opens the config file for editing in $EDITOR",
ShortDescription: `
To use 'ipfs config edit', you must have the $EDITOR environment
variable set to your preferred text editor. variable set to your preferred text editor.
`, `,
},
Run: func(req cmds.Request) (interface{}, error) { Run: func(req cmds.Request) (interface{}, error) {
filename, err := config.Filename(req.Context().ConfigRoot) filename, err := config.Filename(req.Context().ConfigRoot)
......
...@@ -29,7 +29,9 @@ type DiagnosticOutput struct { ...@@ -29,7 +29,9 @@ type DiagnosticOutput struct {
} }
var diagCmd = &cmds.Command{ var diagCmd = &cmds.Command{
Description: "Generates diagnostic reports", Helptext: cmds.HelpText{
Tagline: "Generates diagnostic reports",
},
Subcommands: map[string]*cmds.Command{ Subcommands: map[string]*cmds.Command{
"net": diagNetCmd, "net": diagNetCmd,
......
...@@ -10,7 +10,9 @@ import ( ...@@ -10,7 +10,9 @@ import (
) )
var pinCmd = &cmds.Command{ var pinCmd = &cmds.Command{
Description: "Keeps objects stored locally", Helptext: cmds.HelpText{
Tagline: "Keeps objects stored locally",
},
Subcommands: map[string]*cmds.Command{ Subcommands: map[string]*cmds.Command{
"add": addPinCmd, "add": addPinCmd,
......
...@@ -14,8 +14,15 @@ import ( ...@@ -14,8 +14,15 @@ import (
var errNotOnline = errors.New("This command must be run in online mode. Try running 'ipfs daemon' first.") var errNotOnline = errors.New("This command must be run in online mode. Try running 'ipfs daemon' first.")
var publishCmd = &cmds.Command{ var publishCmd = &cmds.Command{
Description: "Publish an object to IPNS", Helptext: cmds.HelpText{
Help: `IPNS is a PKI namespace, where names are the hashes of public keys, and Tagline: "Publish an object to IPNS",
ShortDescription: `
IPNS is a PKI namespace, where names are the hashes of public keys, and
the private key enables publishing new (signed) values. In publish, the
default value of <name> is your own identity public key.
`,
LongDescription: `
IPNS is a PKI namespace, where names are the hashes of public keys, and
the private key enables publishing new (signed) values. In publish, the the private key enables publishing new (signed) values. In publish, the
default value of <name> is your own identity public key. default value of <name> is your own identity public key.
...@@ -30,8 +37,8 @@ Publish a <ref> to another public key: ...@@ -30,8 +37,8 @@ Publish a <ref> to another public key:
> ipfs name publish QmbCMUZw6JFeZ7Wp9jkzbye3Fzp2GGcPgC3nmeUjfVF87n QmatmE9msSfkKxoffpHwNLNKgwZG8eT9Bud6YoPab52vpy > ipfs name publish QmbCMUZw6JFeZ7Wp9jkzbye3Fzp2GGcPgC3nmeUjfVF87n QmatmE9msSfkKxoffpHwNLNKgwZG8eT9Bud6YoPab52vpy
published name QmbCMUZw6JFeZ7Wp9jkzbye3Fzp2GGcPgC3nmeUjfVF87n to QmatmE9msSfkKxoffpHwNLNKgwZG8eT9Bud6YoPab52vpy published name QmbCMUZw6JFeZ7Wp9jkzbye3Fzp2GGcPgC3nmeUjfVF87n to QmatmE9msSfkKxoffpHwNLNKgwZG8eT9Bud6YoPab52vpy
`, `,
},
Arguments: []cmds.Argument{ Arguments: []cmds.Argument{
cmds.StringArg("name", false, false, "The IPNS name to publish to. Defaults to your node's peerID"), cmds.StringArg("name", false, false, "The IPNS name to publish to. Defaults to your node's peerID"),
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论