@cryptotaxi247 / kubo / commits / e700b1657

Ported remaining command helptext to HelpText struct

Matt Bell committed Nov 13, 2014 at 00:09 UTC e700b165761811fbed302cd56504157f78054397
8 files changed +50 -19
cmd/ipfs2/daemon.go
+4 -1
@@ -15,8 +15,11 @@ import (
15 )
16
17 var daemonCmd = &cmds.Command{
18 + Helptext: cmds.HelpText{
19 + Tagline: "run a network-connected ipfs node", // TODO adjust copy
20 + },
21 +
22 Options: []cmds.Option{},
19 - Help: "run a network-connected ipfs node", // TODO adjust copy
23 Subcommands: map[string]*cmds.Command{},
24 Run: daemonFunc,
25 }
cmd/ipfs2/init.go
+4 -3
@@ -15,9 +15,10 @@ import (
15 )
16
17 var initCmd = &cmds.Command{
18 - Description: "Initializes IPFS config file",
19 - Help: `Initializes IPFS configuration files and generates a new keypair.
20 -`,
18 + Helptext: cmds.HelpText{
19 + Tagline: "Initializes IPFS config file",
20 + ShortDescription: "Initializes IPFS configuration files and generates a new keypair.",
21 + },
22
23 Options: []cmds.Option{
24 cmds.IntOption("bits", "b", "Number of bits to use in the generated RSA private key (defaults to 4096)"),
cmd/ipfs2/tour.go
+9 -3
@@ -60,7 +60,9 @@ IPFS very quickly. To start, run:
60 }
61
62 var cmdIpfsTourNext = &cmds.Command{
63 - Description: "Show the next IPFS Tour topic",
63 + Helptext: cmds.HelpText{
64 + Tagline: "Show the next IPFS Tour topic",
65 + },
66
67 Run: func(req cmds.Request) (interface{}, error) {
68 var w bytes.Buffer
@@ -90,7 +92,9 @@ var cmdIpfsTourNext = &cmds.Command{
92 }
93
94 var cmdIpfsTourRestart = &cmds.Command{
93 - Description: "Restart the IPFS Tour",
95 + Helptext: cmds.HelpText{
96 + Tagline: "Restart the IPFS Tour",
97 + },
98
99 Run: func(req cmds.Request) (interface{}, error) {
100 path := req.Context().ConfigRoot
@@ -109,7 +113,9 @@ var cmdIpfsTourRestart = &cmds.Command{
113 }
114
115 var cmdIpfsTourList = &cmds.Command{
112 - Description: "Show a list of IPFS Tour topics",
116 + Helptext: cmds.HelpText{
117 + Tagline: "Show a list of IPFS Tour topics",
118 + },
119
120 Run: func(req cmds.Request) (interface{}, error) {
121 cfg, err := req.Context().GetConfig()
core/commands2/block.go
+7 -3
@@ -80,9 +80,13 @@ It outputs to stdout, and <key> is a base58 encoded multihash.
80 }
81
82 var blockPutCmd = &cmds.Command{
83 - Description: "Stores input as an IPFS block",
84 - Help: `ipfs block put is a plumbing command for storing raw ipfs blocks.
85 -It reads from stdin, and <key> is a base58 encoded multihash.`,
83 + Helptext: cmds.HelpText{
84 + Tagline: "Stores input as an IPFS block",
85 + ShortDescription: `
86 +ipfs block put is a plumbing command for storing raw ipfs blocks.
87 +It reads from stdin, and <key> is a base58 encoded multihash.
88 +`,
89 + },
90
91 Arguments: []cmds.Argument{
92 cmds.FileArg("data", true, false, "The data to be stored as an IPFS block"),
core/commands2/config.go
+10 -4
@@ -116,10 +116,13 @@ Set the value of the 'datastore.path' key:
116 }
117
118 var configShowCmd = &cmds.Command{
119 - Description: "Outputs the content of the config file",
120 - Help: `WARNING: Your private key is stored in the config file, and it will be
119 + Helptext: cmds.HelpText{
120 + Tagline: "Outputs the content of the config file",
121 + ShortDescription: `
122 +WARNING: Your private key is stored in the config file, and it will be
123 included in the output of this command.
124 `,
125 + },
126
127 Run: func(req cmds.Request) (interface{}, error) {
128 filename, err := config.Filename(req.Context().ConfigRoot)
@@ -132,10 +135,13 @@ included in the output of this command.
135 }
136
137 var configEditCmd = &cmds.Command{
135 - Description: "Opens the config file for editing in $EDITOR",
136 - Help: `To use 'ipfs config edit', you must have the $EDITOR environment
138 + Helptext: cmds.HelpText{
139 + Tagline: "Opens the config file for editing in $EDITOR",
140 + ShortDescription: `
141 +To use 'ipfs config edit', you must have the $EDITOR environment
142 variable set to your preferred text editor.
143 `,
144 + },
145
146 Run: func(req cmds.Request) (interface{}, error) {
147 filename, err := config.Filename(req.Context().ConfigRoot)
core/commands2/diag.go
+3 -1
@@ -29,7 +29,9 @@ type DiagnosticOutput struct {
29 }
30
31 var diagCmd = &cmds.Command{
32 - Description: "Generates diagnostic reports",
32 + Helptext: cmds.HelpText{
33 + Tagline: "Generates diagnostic reports",
34 + },
35
36 Subcommands: map[string]*cmds.Command{
37 "net": diagNetCmd,
core/commands2/pin.go
+3 -1
@@ -10,7 +10,9 @@ import (
10 )
11
12 var pinCmd = &cmds.Command{
13 - Description: "Keeps objects stored locally",
13 + Helptext: cmds.HelpText{
14 + Tagline: "Keeps objects stored locally",
15 + },
16
17 Subcommands: map[string]*cmds.Command{
18 "add": addPinCmd,
core/commands2/publish.go
+10 -3
@@ -14,8 +14,15 @@ import (
14 var errNotOnline = errors.New("This command must be run in online mode. Try running 'ipfs daemon' first.")
15
16 var publishCmd = &cmds.Command{
17 - Description: "Publish an object to IPNS",
18 - Help: `IPNS is a PKI namespace, where names are the hashes of public keys, and
17 + Helptext: cmds.HelpText{
18 + Tagline: "Publish an object to IPNS",
19 + ShortDescription: `
20 +IPNS is a PKI namespace, where names are the hashes of public keys, and
21 +the private key enables publishing new (signed) values. In publish, the
22 +default value of <name> is your own identity public key.
23 +`,
24 + LongDescription: `
25 +IPNS is a PKI namespace, where names are the hashes of public keys, and
26 the private key enables publishing new (signed) values. In publish, the
27 default value of <name> is your own identity public key.
28
@@ -30,8 +37,8 @@ Publish a <ref> to another public key:
37
38 > ipfs name publish QmbCMUZw6JFeZ7Wp9jkzbye3Fzp2GGcPgC3nmeUjfVF87n QmatmE9msSfkKxoffpHwNLNKgwZG8eT9Bud6YoPab52vpy
39 published name QmbCMUZw6JFeZ7Wp9jkzbye3Fzp2GGcPgC3nmeUjfVF87n to QmatmE9msSfkKxoffpHwNLNKgwZG8eT9Bud6YoPab52vpy
33 -
40 `,
41 + },
42
43 Arguments: []cmds.Argument{
44 cmds.StringArg("name", false, false, "The IPNS name to publish to. Defaults to your node's peerID"),