Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-dms3
Commits
2fd8f39c
Commit
2fd8f39c
authored
Nov 12, 2014
by
Matt Bell
Committed by
Juan Batiz-Benet
Nov 14, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cmd/ipfs2: Added comments to explain purpose of CLI root
parent
1342575d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
2 deletions
+7
-2
cmd/ipfs2/ipfs.go
cmd/ipfs2/ipfs.go
+7
-2
No files found.
cmd/ipfs2/ipfs.go
View file @
2fd8f39c
...
...
@@ -5,12 +5,17 @@ import (
commands
"github.com/jbenet/go-ipfs/core/commands2"
)
// This is the CLI root, used for executing commands accessible to CLI clients.
// Some subcommands (like 'ipfs daemon' or 'ipfs init') are only accessible here,
// and can't be called through the HTTP API.
var
Root
=
&
cmds
.
Command
{
Options
:
commands
.
Root
.
Options
,
Helptext
:
commands
.
Root
.
Helptext
,
}
var
rootSubcommands
=
map
[
string
]
*
cmds
.
Command
{
// Commands in localCommands should always be run locally (even if daemon is running).
// They can override subcommands in commands.Root by defining a subcommand with the same name.
var
localCommands
=
map
[
string
]
*
cmds
.
Command
{
"daemon"
:
daemonCmd
,
// TODO name
"init"
:
initCmd
,
// TODO name
"tour"
:
cmdTour
,
...
...
@@ -20,7 +25,7 @@ var rootSubcommands = map[string]*cmds.Command{
func
init
()
{
// setting here instead of in literal to prevent initialization loop
// (some commands make references to Root)
Root
.
Subcommands
=
rootSubc
ommands
Root
.
Subcommands
=
localC
ommands
// copy all subcommands from commands.Root into this root (if they aren't already present)
for
k
,
v
:=
range
commands
.
Root
.
Subcommands
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment