feat(core/commands): expose commands to allow for the development of high-level interface
+ style: sort command list License: MIT Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
Brian Tiger Chow committed
Nov 30, 2014 at 23:33 UTC
65c6bd07bf47168afc62f90608353be5eb6b02a8
14 files changed
+28
-28
core/commands/add.go
+1
-1
@@ -26,7 +26,7 @@ type AddOutput struct {
26
Quiet bool
27
}
28
29
-var addCmd = &cmds.Command{
29
+var AddCmd = &cmds.Command{
30
Helptext: cmds.HelpText{
31
Tagline: "Add an object to ipfs.",
32
ShortDescription: `
core/commands/block.go
+1
-1
@@ -18,7 +18,7 @@ type Block struct {
18
Length int
19
}
20
21
-var blockCmd = &cmds.Command{
21
+var BlockCmd = &cmds.Command{
22
Helptext: cmds.HelpText{
23
Tagline: "Manipulate raw IPFS blocks",
24
ShortDescription: `
core/commands/bootstrap.go
+1
-1
@@ -19,7 +19,7 @@ type BootstrapOutput struct {
19
20
var peerOptionDesc = "A peer to add to the bootstrap list (in the format '<multiaddr>/<peerID>')"
21
22
-var bootstrapCmd = &cmds.Command{
22
+var BootstrapCmd = &cmds.Command{
23
Helptext: cmds.HelpText{
24
Tagline: "Show or edit the list of bootstrap peers",
25
Synopsis: `
core/commands/cat.go
+1
-1
@@ -8,7 +8,7 @@ import (
8
uio "github.com/jbenet/go-ipfs/unixfs/io"
9
)
10
11
-var catCmd = &cmds.Command{
11
+var CatCmd = &cmds.Command{
12
Helptext: cmds.HelpText{
13
Tagline: "Show IPFS object data",
14
ShortDescription: `
core/commands/config.go
+1
-1
@@ -19,7 +19,7 @@ type ConfigField struct {
19
Value interface{}
20
}
21
22
-var configCmd = &cmds.Command{
22
+var ConfigCmd = &cmds.Command{
23
Helptext: cmds.HelpText{
24
Tagline: "get and set IPFS config values",
25
Synopsis: `
core/commands/id.go
+1
-1
@@ -31,7 +31,7 @@ type IdOutput struct {
31
ProtocolVersion string
32
}
33
34
-var idCmd = &cmds.Command{
34
+var IDCmd = &cmds.Command{
35
Helptext: cmds.HelpText{
36
Tagline: "Show IPFS Node ID info",
37
ShortDescription: `
core/commands/ls.go
+1
-1
@@ -21,7 +21,7 @@ type LsOutput struct {
21
Objects []Object
22
}
23
24
-var lsCmd = &cmds.Command{
24
+var LsCmd = &cmds.Command{
25
Helptext: cmds.HelpText{
26
Tagline: "List links from an object.",
27
ShortDescription: `
core/commands/mount_unix.go
+1
-1
@@ -22,7 +22,7 @@ const mountTimeout = time.Second
22
// fuseNoDirectory used to check the returning fuse error
23
const fuseNoDirectory = "fusermount: failed to access mountpoint"
24
25
-var mountCmd = &cmds.Command{
25
+var MountCmd = &cmds.Command{
26
Helptext: cmds.HelpText{
27
Tagline: "Mounts IPFS to the filesystem (read-only)",
28
Synopsis: `
core/commands/name.go
+1
-1
@@ -7,7 +7,7 @@ type IpnsEntry struct {
7
Value string
8
}
9
10
-var nameCmd = &cmds.Command{
10
+var NameCmd = &cmds.Command{
11
Helptext: cmds.HelpText{
12
Tagline: "IPFS namespace (IPNS) tool",
13
Synopsis: `
core/commands/object.go
+1
-1
@@ -24,7 +24,7 @@ type Node struct {
24
Data []byte
25
}
26
27
-var objectCmd = &cmds.Command{
27
+var ObjectCmd = &cmds.Command{
28
Helptext: cmds.HelpText{
29
Tagline: "Interact with ipfs objects",
30
ShortDescription: `
core/commands/pin.go
+1
-1
@@ -9,7 +9,7 @@ import (
9
u "github.com/jbenet/go-ipfs/util"
10
)
11
12
-var pinCmd = &cmds.Command{
12
+var PinCmd = &cmds.Command{
13
Helptext: cmds.HelpText{
14
Tagline: "Pin (and unpin) objects to local storage",
15
},
core/commands/refs.go
+1
-1
@@ -25,7 +25,7 @@ func KeyListTextMarshaler(res cmds.Response) ([]byte, error) {
25
return []byte(s), nil
26
}
27
28
-var refsCmd = &cmds.Command{
28
+var RefsCmd = &cmds.Command{
29
Helptext: cmds.HelpText{
30
Tagline: "Lists link hashes from an object",
31
ShortDescription: `
core/commands/root.go
+15
-15
@@ -62,24 +62,24 @@ Use 'ipfs <command> --help' to learn more about each command.
62
var CommandsDaemonCmd = CommandsCmd(Root)
63
64
var rootSubcommands = map[string]*cmds.Command{
65
- "cat": catCmd,
66
- "ls": lsCmd,
65
+ "add": AddCmd,
66
+ "block": BlockCmd,
67
+ "bootstrap": BootstrapCmd,
68
+ "cat": CatCmd,
69
"commands": CommandsDaemonCmd,
68
- "name": nameCmd,
69
- "add": addCmd,
70
- "log": LogCmd,
70
+ "config": ConfigCmd,
71
"diag": DiagCmd,
72
- "pin": pinCmd,
73
- "version": VersionCmd,
74
- "config": configCmd,
75
- "bootstrap": bootstrapCmd,
76
- "mount": mountCmd,
77
- "block": blockCmd,
72
+ "id": IDCmd,
73
+ "log": LogCmd,
74
+ "ls": LsCmd,
75
+ "mount": MountCmd,
76
+ "name": NameCmd,
77
+ "object": ObjectCmd,
78
+ "pin": PinCmd,
79
+ "refs": RefsCmd,
80
+ "swarm": SwarmCmd,
81
"update": UpdateCmd,
79
- "object": objectCmd,
80
- "refs": refsCmd,
81
- "id": idCmd,
82
- "swarm": swarmCmd,
82
+ "version": VersionCmd,
83
}
84
85
func init() {
core/commands/swarm.go
+1
-1
@@ -17,7 +17,7 @@ type stringList struct {
17
Strings []string
18
}
19
20
-var swarmCmd = &cmds.Command{
20
+var SwarmCmd = &cmds.Command{
21
Helptext: cmds.HelpText{
22
Tagline: "swarm inspection tool",
23
Synopsis: `