core/commands2: Added descriptions for all the existing commands
Matt Bell committed
Nov 8, 2014 at 01:02 UTC
c2615d34810a8de3e472d4fd102a5153abb30d5c
16 files changed
+155
-164
core/commands2/bootstrap.go
+20
-19
@@ -10,26 +10,19 @@ import (
10
11
cmds "github.com/jbenet/go-ipfs/commands"
12
config "github.com/jbenet/go-ipfs/config"
13
- //peer "github.com/jbenet/go-ipfs/peer"
14
- //u "github.com/jbenet/go-ipfs/util"
13
)
14
15
type BootstrapOutput struct {
16
Peers []*config.BootstrapPeer
17
}
18
21
-var bootstrapCmd = &cmds.Command{
22
- Help: `ipfs bootstrap - show, or manipulate bootstrap node addresses
23
-
24
-Running 'ipfs bootstrap' with no arguments will run 'ipfs bootstrap list'.
25
-
26
-Commands:
27
-
28
- list Show the boostrap list.
29
- add <address> Add a node's address to the bootstrap list.
30
- remove <address> Remove an address from the bootstrap list.
19
+var peerOptionDesc = "A peer to add to the bootstrap list (in the format '<multiaddr>/<peerID>')"
20
21
+var bootstrapCmd = &cmds.Command{
22
+ Description: "Show or edit the list of bootstrap peers",
23
+ Help: `Running 'ipfs bootstrap' with no arguments will run 'ipfs bootstrap list'.
24
` + bootstrapSecurityWarning,
25
+
26
Run: bootstrapListCmd.Run,
27
Marshallers: bootstrapListCmd.Marshallers,
28
Subcommands: map[string]*cmds.Command{
@@ -40,11 +33,14 @@ Commands:
33
}
34
35
var bootstrapAddCmd = &cmds.Command{
36
+ Description: "Add peers to the bootstrap list",
37
+ Help: `Outputs a list of peers that were added (that weren't already
38
+in the bootstrap list).
39
+` + bootstrapSecurityWarning,
40
+
41
Arguments: []cmds.Argument{
44
- cmds.Argument{"peer", cmds.ArgString, true, true},
42
+ cmds.Argument{"peer", cmds.ArgString, true, true, peerOptionDesc},
43
},
46
- Help: `ipfs bootstrap add - add addresses to the bootstrap list
47
-` + bootstrapSecurityWarning,
44
Run: func(res cmds.Response, req cmds.Request) {
45
input, err := bootstrapInputToPeers(req.Arguments())
46
if err != nil {
@@ -81,11 +77,13 @@ var bootstrapAddCmd = &cmds.Command{
77
}
78
79
var bootstrapRemoveCmd = &cmds.Command{
80
+ Description: "Removes peers from the bootstrap list",
81
+ Help: `Outputs the list of peers that were removed.
82
+` + bootstrapSecurityWarning,
83
+
84
Arguments: []cmds.Argument{
85
- cmds.Argument{"peer", cmds.ArgString, true, true},
85
+ cmds.Argument{"peer", cmds.ArgString, true, true, peerOptionDesc},
86
},
87
- Help: `ipfs bootstrap remove - remove addresses from the bootstrap list
88
-` + bootstrapSecurityWarning,
87
Run: func(res cmds.Response, req cmds.Request) {
88
input, err := bootstrapInputToPeers(req.Arguments())
89
if err != nil {
@@ -122,7 +120,10 @@ var bootstrapRemoveCmd = &cmds.Command{
120
}
121
122
var bootstrapListCmd = &cmds.Command{
125
- Help: "ipfs bootstrap list - Show addresses in the bootstrap list",
123
+ Description: "Lists peers in the bootstrap list",
124
+ Help: `Peers are output in the format '<multiaddr>/<peerID>'.
125
+`,
126
+
127
Run: func(res cmds.Response, req cmds.Request) {
128
peers := req.Context().Config.Bootstrap
129
res.SetOutput(&BootstrapOutput{peers})
core/commands2/cat.go
+7
-6
@@ -10,14 +10,15 @@ import (
10
)
11
12
var catCmd = &cmds.Command{
13
- Arguments: []cmds.Argument{
14
- cmds.Argument{"object", cmds.ArgString, true, true},
15
- },
16
- Help: `ipfs cat <object> - Show ipfs object data.
17
-
18
- Retrieves the object named by <object> and outputs the data
13
+ Description: "Show IPFS object data",
14
+ Help: `Retrieves the object named by <ipfs-path> and outputs the data
15
it contains.
16
`,
17
+
18
+ Arguments: []cmds.Argument{
19
+ cmds.Argument{"ipfs-path", cmds.ArgString, true, true,
20
+ "The path to the IPFS object(s) to be outputted"},
21
+ },
22
Run: func(res cmds.Response, req cmds.Request) {
23
node := req.Context().Node
24
readers := make([]io.Reader, 0, len(req.Arguments()))
core/commands2/commands.go
+3
-5
@@ -13,12 +13,10 @@ type Command struct {
13
}
14
15
var commandsCmd = &cmds.Command{
16
- // TODO UsageLine: "commands",
17
- // TODO Short: "List all available commands.",
18
- Help: `ipfs commands - List all available commands.
16
+ Description: "List all available commands.",
17
+ Help: `Lists all available commands (and subcommands) and exits.
18
+`,
19
20
- Lists all available commands (and sub-commands) and exits.
21
- `,
20
Run: func(res cmds.Response, req cmds.Request) {
21
root := outputCommand("ipfs", Root)
22
res.SetOutput(&root)
core/commands2/config.go
+19
-13
@@ -18,18 +18,8 @@ type ConfigField struct {
18
}
19
20
var configCmd = &cmds.Command{
21
- Arguments: []cmds.Argument{
22
- cmds.Argument{"key", cmds.ArgString, true, false},
23
- cmds.Argument{"value", cmds.ArgString, false, false},
24
- },
25
- Help: `ipfs config <key> [value] - Get/Set ipfs config values.
26
-
27
- ipfs config <key> - Get value of <key>
28
- ipfs config <key> <value> - Set value of <key> to <value>
29
- ipfs config show - Show config file
30
- ipfs config edit - Edit config file in $EDITOR
31
-
32
-Examples:
21
+ Description: "Get/set IPFS config values",
22
+ Help: `Examples:
23
24
Get the value of the 'datastore.path' key:
25
@@ -38,8 +28,14 @@ Examples:
28
Set the value of the 'datastore.path' key:
29
30
ipfs config datastore.path ~/.go-ipfs/datastore
41
-
31
`,
32
+
33
+ Arguments: []cmds.Argument{
34
+ cmds.Argument{"key", cmds.ArgString, true, false,
35
+ "The key of the config entry (e.g. \"Addresses.API\")"},
36
+ cmds.Argument{"value", cmds.ArgString, false, false,
37
+ "The value to set the config entry to"},
38
+ },
39
Run: func(res cmds.Response, req cmds.Request) {
40
args := req.Arguments()
41
@@ -110,6 +106,11 @@ Examples:
106
}
107
108
var configShowCmd = &cmds.Command{
109
+ Description: "Outputs the content of the config file",
110
+ Help: `WARNING: Your private key is stored in the config file, and it will be
111
+included in the output of this command.
112
+`,
113
+
114
Run: func(res cmds.Response, req cmds.Request) {
115
filename, err := config.Filename(req.Context().ConfigRoot)
116
if err != nil {
@@ -128,6 +129,11 @@ var configShowCmd = &cmds.Command{
129
}
130
131
var configEditCmd = &cmds.Command{
132
+ Description: "Opens the config file for editing in $EDITOR",
133
+ Help: `To use 'ipfs config edit', you must have the $EDITOR environment
134
+variable set to your preferred text editor.
135
+`,
136
+
137
Run: func(res cmds.Response, req cmds.Request) {
138
filename, err := config.Filename(req.Context().ConfigRoot)
139
if err != nil {
core/commands2/diag.go
+6
-10
@@ -28,24 +28,20 @@ type DiagnosticOutput struct {
28
}
29
30
var diagCmd = &cmds.Command{
31
- Help: `ipfs diag - Generate diagnostic reports.
31
+ Description: "Generates diagnostic reports",
32
33
- ipfs diag net - Generate a network diagnostic report.
34
- `,
33
Subcommands: map[string]*cmds.Command{
34
"net": diagNetCmd,
35
},
36
}
37
38
var diagNetCmd = &cmds.Command{
41
- // TODO UsageLine: "net-diag",
42
- // TODO Short: "Generate a diagnostics report",
43
- Help: `ipfs diag net - Generate a network diagnostics report.
44
-
45
- Sends out a message to each node in the network recursively
46
- requesting a listing of data about them including number of
47
- connected peers and latencies between them.
39
+ Description: "Generates a network diagnostics report",
40
+ Help: `Sends out a message to each node in the network recursively
41
+requesting a listing of data about them including number of
42
+connected peers and latencies between them.
43
`,
44
+
45
Run: func(res cmds.Response, req cmds.Request) {
46
n := req.Context().Node
47
core/commands2/log.go
+9
-11
@@ -8,19 +8,17 @@ import (
8
)
9
10
var logCmd = &cmds.Command{
11
+ Description: "Change the logging level",
12
+ Help: `'ipfs log' is a utility command used to change the logging
13
+output of a running daemon.
14
+`,
15
+
16
Arguments: []cmds.Argument{
12
- cmds.Argument{"subsystem", cmds.ArgString, true, false},
13
- cmds.Argument{"level", cmds.ArgString, true, false},
17
+ cmds.Argument{"subsystem", cmds.ArgString, true, false,
18
+ "the subsystem logging identifier. Use * for all subsystems."},
19
+ cmds.Argument{"level", cmds.ArgString, true, false,
20
+ "one of: debug, info, notice, warning, error, critical"},
21
},
15
- // TODO UsageLine: "log <name> <level> ",
16
- // TODO Short: "switch logging levels of a running daemon",
17
- Help: `ipfs log <subsystem> <level> - switch logging levels of a running daemon
18
-
19
- <subsystem> is a the subsystem logging identifier. Use * for all subsystems.
20
- <level> is one of: debug, info, notice, warning, error, critical
21
-
22
-ipfs log is a utility command used to change the logging output of a running daemon.
23
-`,
22
Run: func(res cmds.Response, req cmds.Request) {
23
args := req.Arguments()
24
if err := u.SetLogLevel(args[0].(string), args[1].(string)); err != nil {
core/commands2/ls.go
+7
-12
@@ -23,20 +23,15 @@ type LsOutput struct {
23
}
24
25
var lsCmd = &cmds.Command{
26
+ Description: "List links from an object.",
27
+ Help: `Retrieves the object named by <ipfs-path> and displays the links
28
+it contains.
29
+`,
30
+
31
Arguments: []cmds.Argument{
27
- cmds.Argument{"object", cmds.ArgString, false, true},
32
+ cmds.Argument{"ipfs-path", cmds.ArgString, false, true,
33
+ "The path to the IPFS object(s) to list links from"},
34
},
29
- // TODO UsageLine: "ls",
30
- // TODO Short: "List links from an object.",
31
- // TODO docs read ipfs-path. argument says option. which?
32
- Help: `ipfs ls <ipfs-path> - List links from an object.
33
-
34
- Retrieves the object named by <ipfs-path> and displays the links
35
- it contains, with the following format:
36
-
37
- <link base58 hash> <link size in bytes> <link name>
38
-
39
-`,
35
Run: func(res cmds.Response, req cmds.Request) {
36
node := req.Context().Node
37
core/commands2/mount_unix.go
+10
-11
@@ -17,25 +17,24 @@ import (
17
const mountTimeout = time.Second
18
19
var mountCmd = &cmds.Command{
20
- Arguments: []cmds.Argument{
21
- cmds.Argument{Name: "os-path", Type: cmds.ArgString, Required: false, Variadic: false},
22
- },
20
+ Description: "Mounts IPFS to the filesystem (read-only)",
21
+ Help: `Mount ipfs at a read-only mountpoint on the OS. All ipfs objects
22
+will be accessible under that directory. Note that the root will
23
+not be listable, as it is virtual. Accessing known paths directly.
24
+`,
25
+
26
Options: []cmds.Option{
27
28
// TODO text: specify a mountpoint for ipfs
29
// TODO longform
27
- cmds.Option{[]string{"f"}, cmds.String},
30
+ cmds.Option{[]string{"f"}, cmds.String,
31
+ "The path where IPFS should be mounted (default is '/ipfs')"},
32
33
// TODO text: specify a mountpoint for ipns
34
// TODO longform
31
- cmds.Option{[]string{"n"}, cmds.String},
35
+ cmds.Option{[]string{"n"}, cmds.String,
36
+ "The path where IPNS should be mounted (default is '/ipns')"},
37
},
33
- Help: `ipfs mount <os-path> - Mount an ipfs read-only mountpoint.
34
-
35
- Mount ipfs at a read-only mountpoint on the OS. All ipfs objects
36
- will be accessible under that directory. Note that the root will
37
- not be listable, as it is virtual. Accessing known paths directly.
38
-`,
38
Run: func(res cmds.Response, req cmds.Request) {
39
ctx := req.Context()
40
core/commands2/mount_windows.go
+3
-1
@@ -7,7 +7,9 @@ import (
7
)
8
9
var ipfsMount = &cmds.Command{
10
- Help: `Not yet implemented on Windows.`,
10
+ Description: "Not yet implemented on Windows",
11
+ Help: `Not yet implemented on Windows. :(`,
12
+
13
Run: func(res cmds.Response, req cmds.Request) {
14
res.SetError(errors.New("Mount isn't compatible with Windows yet"), cmds.ErrNormal)
15
},
core/commands2/name.go
+4
-9
@@ -8,14 +8,8 @@ type IpnsEntry struct {
8
}
9
10
var nameCmd = &cmds.Command{
11
- // TODO UsageLine: "name [publish | resolve]",
12
- // TODO Short: "ipfs namespace (ipns) tool",
13
- Help: `ipfs name - Get/Set ipfs config values.
14
-
15
- ipfs name publish [<name>] <ref> - Assign the <ref> to <name>
16
- ipfs name resolve [<name>] - Resolve the <ref> value of <name>
17
-
18
-IPNS is a PKI namespace, where names are the hashes of public keys, and
11
+ Description: "IPFS namespace (IPNS) tool",
12
+ Help: `IPNS is a PKI namespace, where names are the hashes of public keys, and
13
the private key enables publishing new (signed) values. In both publish
14
and resolve, the default value of <name> is your own identity public key.
15
@@ -37,12 +31,13 @@ Resolve the value of your identity:
31
> ipfs name resolve
32
QmatmE9msSfkKxoffpHwNLNKgwZG8eT9Bud6YoPab52vpy
33
40
-Resolve te value of another name:
34
+Resolve the value of another name:
35
36
> ipfs name resolve QmbCMUZw6JFeZ7Wp9jkzbye3Fzp2GGcPgC3nmeUjfVF87n
37
QmatmE9msSfkKxoffpHwNLNKgwZG8eT9Bud6YoPab52vpy
38
39
`,
40
+
41
Subcommands: map[string]*cmds.Command{
42
"publish": publishCmd,
43
"resolve": resolveCmd,
core/commands2/pin.go
+21
-24
@@ -10,10 +10,8 @@ import (
10
)
11
12
var pinCmd = &cmds.Command{
13
- // TODO UsageLine: "pin",
14
- // TODO Short: "",
15
- Help: `ipfs pin [add|rm] - object pinning commands
16
- `,
13
+ Description: "Keeps objects stored locally",
14
+
15
Subcommands: map[string]*cmds.Command{
16
"add": addPinCmd,
17
"rm": rmPinCmd,
@@ -21,19 +19,18 @@ var pinCmd = &cmds.Command{
19
}
20
21
var addPinCmd = &cmds.Command{
24
- // TODO UsageLine: "add",
25
- // TODO Short: "pin an ipfs object to local storage.",
26
- Help: `ipfs pin add <ipfs-path> - pin ipfs object to local storage.
27
-
28
- Retrieves the object named by <ipfs-path> and stores it locally
29
- on disk.
22
+ Description: "Pins objects to local storage",
23
+ Help: `Keeps the object(s) named by <ipfs-path> in local storage. If the object
24
+isn't already being stored, IPFS retrieves it.
25
`,
31
- Options: []cmds.Option{
32
- cmds.Option{[]string{"recursive", "r"}, cmds.Bool},
33
- cmds.Option{[]string{"depth", "d"}, cmds.Uint},
34
- },
26
+
27
Arguments: []cmds.Argument{
36
- cmds.Argument{"object", cmds.ArgString, true, true},
28
+ cmds.Argument{"ipfs-path", cmds.ArgString, true, true,
29
+ "Path to object(s) to be pinned"},
30
+ },
31
+ Options: []cmds.Option{
32
+ cmds.Option{[]string{"recursive", "r"}, cmds.Bool,
33
+ "Recursively pin the object linked to by the specified object(s)"},
34
},
35
Run: func(res cmds.Response, req cmds.Request) {
36
n := req.Context().Node
@@ -58,18 +55,18 @@ var addPinCmd = &cmds.Command{
55
}
56
57
var rmPinCmd = &cmds.Command{
61
- // TODO UsageLine: "rm",
62
- // TODO Short: "unpin an ipfs object from local storage.",
63
- Help: `ipfs pin rm <ipfs-path> - unpin ipfs object from local storage.
64
-
65
- Removes the pin from the given object allowing it to be garbage
58
+ Description: "Unpin an object from local storage",
59
+ Help: `Removes the pin from the given object allowing it to be garbage
60
collected if needed.
61
`,
68
- Options: []cmds.Option{
69
- cmds.Option{[]string{"recursive", "r"}, cmds.Bool},
70
- },
62
+
63
Arguments: []cmds.Argument{
72
- cmds.Argument{"object", cmds.ArgString, true, true},
64
+ cmds.Argument{"ipfs-path", cmds.ArgString, true, true,
65
+ "Path to object(s) to be unpinned"},
66
+ },
67
+ Options: []cmds.Option{
68
+ cmds.Option{[]string{"recursive", "r"}, cmds.Bool,
69
+ "Recursively unpin the object linked to by the specified object(s)"},
70
},
71
Run: func(res cmds.Response, req cmds.Request) {
72
n := req.Context().Node
core/commands2/publish.go
+8
-9
@@ -14,13 +14,9 @@ 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
- // TODO UsageLine: "publish",
18
- // TODO Short: "publish a <ref> to ipns.",
19
- Help: `ipfs name publish [<name>] <ref> - publish a <ref> to ipns.
20
-
21
-IPNS is a PKI namespace, where names are the hashes of public keys, and
22
-the private key enables publishing new (signed) values. In publish, the
23
-default value of <name> is your own identity public key.
17
+ Description: "Publish an object to IPNS",
18
+ Help: `IPNS is a PKI namespace, where names are the hashes of public keys, and
19
+the private key enables publishing new (signed) values.
20
21
Examples:
22
@@ -35,9 +31,12 @@ Publish a <ref> to another public key:
31
published name QmbCMUZw6JFeZ7Wp9jkzbye3Fzp2GGcPgC3nmeUjfVF87n to QmatmE9msSfkKxoffpHwNLNKgwZG8eT9Bud6YoPab52vpy
32
33
`,
34
+
35
Arguments: []cmds.Argument{
39
- cmds.Argument{"name", cmds.ArgString, false, false},
40
- cmds.Argument{"object", cmds.ArgString, true, false},
36
+ cmds.Argument{"name", cmds.ArgString, false, false,
37
+ "The IPNS name to publish to. Defaults to your node's peerID"},
38
+ cmds.Argument{"ipfs-path", cmds.ArgString, true, false,
39
+ "IPFS path of the obejct to be published at <name>"},
40
},
41
Run: func(res cmds.Response, req cmds.Request) {
42
n := req.Context().Node
core/commands2/resolve.go
+5
-8
@@ -12,13 +12,9 @@ type ResolveOutput struct {
12
}
13
14
var resolveCmd = &cmds.Command{
15
- // TODO UsageLine: "resolve",
16
- // TODO Short: "resolve an ipns name to a <ref>",
17
- Help: `ipfs name resolve [<name>] - Resolve an ipns name to a <ref>.
18
-
19
-IPNS is a PKI namespace, where names are the hashes of public keys, and
20
-the private key enables publishing new (signed) values. In resolve, the
21
-default value of <name> is your own identity public key.
15
+ Description: "Gets the value currently published at an IPNS name",
16
+ Help: `IPNS is a PKI namespace, where names are the hashes of public keys, and
17
+the private key enables publishing new (signed) values.
18
19
20
Examples:
@@ -36,7 +32,8 @@ Resolve te value of another name:
32
`,
33
34
Arguments: []cmds.Argument{
39
- cmds.Argument{"name", cmds.ArgString, false, true},
35
+ cmds.Argument{"name", cmds.ArgString, false, true,
36
+ "The IPNS name to resolve. Defaults to your node's peerID."},
37
},
38
Run: func(res cmds.Response, req cmds.Request) {
39
core/commands2/root.go
+13
-12
@@ -1,9 +1,6 @@
1
package commands
2
3
import (
4
- "fmt"
5
- "strings"
6
-
4
cmds "github.com/jbenet/go-ipfs/commands"
5
u "github.com/jbenet/go-ipfs/util"
6
)
@@ -16,15 +13,8 @@ type TestOutput struct {
13
}
14
15
var Root = &cmds.Command{
19
- Options: []cmds.Option{
20
- cmds.Option{[]string{"config", "c"}, cmds.String},
21
- cmds.Option{[]string{"debug", "D"}, cmds.Bool},
22
- cmds.Option{[]string{"help", "h"}, cmds.Bool},
23
- cmds.Option{[]string{"local", "L"}, cmds.Bool},
24
- },
25
- Help: `ipfs - global versioned p2p merkledag file system
26
-
27
-Basic commands:
16
+ Description: "Global P2P Merkle-DAG filesystem",
17
+ Help: `Basic commands:
18
19
init Initialize ipfs local configuration.
20
add <path> Add an object to ipfs.
@@ -53,6 +43,17 @@ Plumbing commands:
43
44
Use "ipfs help <command>" for more information about a command.
45
`,
46
+
47
+ Options: []cmds.Option{
48
+ cmds.Option{[]string{"config", "c"}, cmds.String,
49
+ "Path to the configuration file to use"},
50
+ cmds.Option{[]string{"debug", "D"}, cmds.Bool,
51
+ "Operate in debug mode"},
52
+ cmds.Option{[]string{"help", "h"}, cmds.Bool,
53
+ "Show the command help text"},
54
+ cmds.Option{[]string{"local", "L"}, cmds.Bool,
55
+ "Run the command locally, instead of using the daemon"},
56
+ },
57
}
58
59
var rootSubcommands = map[string]*cmds.Command{
core/commands2/update.go
+14
-9
@@ -15,14 +15,10 @@ type UpdateOutput struct {
15
}
16
17
var updateCmd = &cmds.Command{
18
- Help: `ipfs update - check for updates and apply them
19
-
20
- ipfs update - apply
21
- ipfs update check - just check
22
- ipfs update log - list the changelogs
23
-
24
-ipfs update is a utility command used to check for updates and apply them.
18
+ Description: "Downloads and installs updates for IPFS",
19
+ Help: `ipfs update is a utility command used to check for updates and apply them.
20
`,
21
+
22
Run: func(res cmds.Response, req cmds.Request) {
23
n := req.Context().Node
24
@@ -55,7 +51,12 @@ ipfs update is a utility command used to check for updates and apply them.
51
}
52
53
var updateCheckCmd = &cmds.Command{
58
- Help: `ipfs update check <key>`,
54
+ Description: "Checks if updates are available",
55
+ Help: `'ipfs update check' checks if any updates are available for IPFS.
56
+
57
+Nothing will be downloaded or installed.
58
+`,
59
+
60
Run: func(res cmds.Response, req cmds.Request) {
61
n := req.Context().Node
62
@@ -84,7 +85,10 @@ var updateCheckCmd = &cmds.Command{
85
}
86
87
var updateLogCmd = &cmds.Command{
87
- Help: `ipfs update log - list the last versions and their changelog`,
88
+ Description: "List the changelog for the latest versions of IPFS",
89
+ Help: `This command is not yet implemented.
90
+`,
91
+
92
Run: func(res cmds.Response, req cmds.Request) {
93
n := req.Context().Node
94
@@ -151,5 +155,6 @@ func updateCheck(n *core.IpfsNode) (*UpdateOutput, error) {
155
156
// updateLog lists the version available online
157
func updateLog(n *core.IpfsNode) (interface{}, error) {
158
+ // TODO
159
return nil, errors.New("Not yet implemented")
160
}
core/commands2/version.go
+6
-5
@@ -12,13 +12,14 @@ type VersionOutput struct {
12
}
13
14
var versionCmd = &cmds.Command{
15
+ Description: "Outputs the current version of IPFS",
16
+ Help: `Returns the version number of IPFS.
17
+`,
18
+
19
Options: []cmds.Option{
16
- cmds.Option{[]string{"number", "n"}, cmds.Bool},
20
+ cmds.Option{[]string{"number", "n"}, cmds.Bool,
21
+ "Only output the version number"},
22
},
18
- Help: `ipfs version - Show ipfs version information.
19
-
20
- Returns the current version of ipfs and exits.
21
- `,
23
Run: func(res cmds.Response, req cmds.Request) {
24
res.SetOutput(&VersionOutput{
25
Version: config.CurrentVersionNumber,