cmd/ipfs2: Added descriptions for 'init', 'tour'
Matt Bell committed
Nov 8, 2014 at 01:02 UTC
2b8ef917b8fb17c9a1c77f20da3523e9d8d56b6c
2 files changed
+25
-28
cmd/ipfs2/init.go
+12
-9
@@ -16,17 +16,20 @@ import (
16
)
17
18
var initCmd = &cmds.Command{
19
+ Description: "Initializes IPFS config file",
20
+ Help: `Initializes IPFS configuration files and generates a new keypair.
21
+`,
22
+
23
Options: []cmds.Option{
20
- cmds.Option{[]string{"bits", "b"}, cmds.Int},
21
- cmds.Option{[]string{"passphrase", "p"}, cmds.String},
22
- cmds.Option{[]string{"force", "f"}, cmds.Bool},
23
- cmds.Option{[]string{"datastore", "d"}, cmds.String},
24
+ cmds.Option{[]string{"bits", "b"}, cmds.Int,
25
+ "Number of bits to use in the generated RSA private key (defaults to 4096)"},
26
+ cmds.Option{[]string{"passphrase", "p"}, cmds.String,
27
+ "Passphrase for encrypting the private key"},
28
+ cmds.Option{[]string{"force", "f"}, cmds.Bool,
29
+ "Overwrite existing config (if it exists)"},
30
+ cmds.Option{[]string{"datastore", "d"}, cmds.String,
31
+ "Location for the IPFS data store"},
32
},
25
- Help: `ipfs init
26
-
27
- Initializes ipfs configuration files and generates a
28
- new keypair.
29
- `,
33
Run: func(res cmds.Response, req cmds.Request) {
34
35
arg, found := req.Option("d")
cmd/ipfs2/tour.go
+13
-19
@@ -13,27 +13,18 @@ import (
13
)
14
15
var cmdTour = &cmds.Command{
16
-
17
- Arguments: []cmds.Argument{
18
- cmds.Argument{"number", cmds.ArgString, false, false},
19
- },
20
-
21
- // TODO UsageLine: "tour [<number>]",
22
- // TODO Short: "Take the IPFS Tour.",
23
-
24
- Help: `ipfs tour - Take the IPFS Tour.
25
-
26
- ipfs tour [<number>] - Show tour topic. Default to current.
27
- ipfs tour next - Show the next tour topic.
28
- ipfs tour list - Show a list of topics.
29
- ipfs tour restart - Restart the tour.
30
-
31
-This is a tour that takes you through various IPFS concepts,
16
+ Description: "An introduction to IPFS",
17
+ Help: `This is a tour that takes you through various IPFS concepts,
18
features, and tools to make sure you get up to speed with
19
IPFS very quickly. To start, run:
20
21
ipfs tour
22
`,
23
+
24
+ Arguments: []cmds.Argument{
25
+ cmds.Argument{"number", cmds.ArgString, false, false,
26
+ "The number of the topic you would like to tour"},
27
+ },
28
Subcommands: map[string]*cmds.Command{
29
"list": cmdIpfsTourList,
30
"next": cmdIpfsTourNext,
@@ -65,7 +56,8 @@ IPFS very quickly. To start, run:
56
}
57
58
var cmdIpfsTourNext = &cmds.Command{
68
- Help: "Show the next IPFS Tour topic.",
59
+ Description: "Show the next IPFS Tour topic",
60
+
61
Run: func(res cmds.Response, req cmds.Request) {
62
var w bytes.Buffer
63
cfg := req.Context().Config
@@ -92,7 +84,8 @@ var cmdIpfsTourNext = &cmds.Command{
84
}
85
86
var cmdIpfsTourRestart = &cmds.Command{
95
- Help: "Restart the IPFS Tour.",
87
+ Description: "Restart the IPFS Tour",
88
+
89
Run: func(res cmds.Response, req cmds.Request) {
90
path := req.Context().ConfigRoot
91
cfg := req.Context().Config
@@ -106,7 +99,8 @@ var cmdIpfsTourRestart = &cmds.Command{
99
}
100
101
var cmdIpfsTourList = &cmds.Command{
109
- Help: "Show a list of IPFS Tour topics.",
102
+ Description: "Show a list of IPFS Tour topics",
103
+
104
Run: func(res cmds.Response, req cmds.Request) {
105
var w bytes.Buffer
106
tourListCmd(&w, req.Context().Config)