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
cac8844b
Commit
cac8844b
authored
Oct 31, 2014
by
Matt Bell
Committed by
Juan Batiz-Benet
Nov 14, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cmd/ipfs: Reverted back to secondary CLI root command
parent
24814a41
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
24 additions
and
12 deletions
+24
-12
cmd/ipfs2/daemon.go
cmd/ipfs2/daemon.go
+3
-3
cmd/ipfs2/init.go
cmd/ipfs2/init.go
+1
-2
cmd/ipfs2/ipfs.go
cmd/ipfs2/ipfs.go
+15
-0
cmd/ipfs2/main.go
cmd/ipfs2/main.go
+5
-5
core/commands2/root.go
core/commands2/root.go
+0
-2
No files found.
c
ore/command
s2/daemon.go
→
c
md/ipf
s2/daemon.go
View file @
cac8844b
package
commands
package
main
import
(
"fmt"
...
...
@@ -10,11 +10,11 @@ import (
cmds
"github.com/jbenet/go-ipfs/commands"
cmdsHttp
"github.com/jbenet/go-ipfs/commands/http"
"github.com/jbenet/go-ipfs/core"
commands
"github.com/jbenet/go-ipfs/core/commands2"
daemon
"github.com/jbenet/go-ipfs/daemon2"
)
var
daemonCmd
=
&
cmds
.
Command
{
Private
:
true
,
Options
:
[]
cmds
.
Option
{},
Help
:
"TODO"
,
Subcommands
:
map
[
string
]
*
cmds
.
Command
{},
...
...
@@ -50,7 +50,7 @@ func daemonFunc(res cmds.Response, req cmds.Request) {
return
}
handler
:=
cmdsHttp
.
Handler
{
*
ctx
,
Root
}
handler
:=
cmdsHttp
.
Handler
{
*
ctx
,
commands
.
Root
}
http
.
Handle
(
cmdsHttp
.
ApiPath
+
"/"
,
handler
)
fmt
.
Printf
(
"API server listening on '%s'
\n
"
,
host
)
...
...
c
ore/command
s2/init.go
→
c
md/ipf
s2/init.go
View file @
cac8844b
package
commands
package
main
import
(
"encoding/base64"
...
...
@@ -15,7 +15,6 @@ import (
)
var
initCmd
=
&
cmds
.
Command
{
Private
:
true
,
Options
:
[]
cmds
.
Option
{
cmds
.
Option
{[]
string
{
"bits"
,
"b"
},
cmds
.
Int
},
cmds
.
Option
{[]
string
{
"passphrase"
,
"p"
},
cmds
.
String
},
...
...
cmd/ipfs2/ipfs.go
0 → 100644
View file @
cac8844b
package
main
import
(
cmds
"github.com/jbenet/go-ipfs/commands"
commands
"github.com/jbenet/go-ipfs/core/commands2"
)
var
Root
=
&
cmds
.
Command
{
Options
:
commands
.
Root
.
Options
,
Help
:
commands
.
Root
.
Help
,
Subcommands
:
map
[
string
]
*
cmds
.
Command
{
"daemon"
:
daemonCmd
,
"init"
:
initCmd
,
},
}
cmd/ipfs2/main.go
View file @
cac8844b
...
...
@@ -22,13 +22,13 @@ var log = u.Logger("cmd/ipfs")
func
main
()
{
args
:=
os
.
Args
[
1
:
]
req
,
err
:=
cmdsCli
.
Parse
(
args
,
commands
.
Root
)
req
,
root
,
err
:=
cmdsCli
.
Parse
(
args
,
Root
,
commands
.
Root
)
if
err
!=
nil
{
fmt
.
Println
(
err
)
os
.
Exit
(
1
)
}
options
,
err
:=
getOptions
(
req
,
commands
.
R
oot
)
options
,
err
:=
getOptions
(
req
,
r
oot
)
if
err
!=
nil
{
fmt
.
Println
(
err
)
os
.
Exit
(
1
)
...
...
@@ -80,8 +80,8 @@ func main() {
}
var
res
cmds
.
Response
if
r
eq
.
Command
()
.
Private
{
res
=
commands
.
R
oot
.
Call
(
req
)
if
r
oot
==
Root
{
res
=
r
oot
.
Call
(
req
)
}
else
{
local
,
found
:=
options
.
Option
(
"local"
)
...
...
@@ -101,7 +101,7 @@ func main() {
}
ctx
.
Node
=
node
res
=
commands
.
R
oot
.
Call
(
req
)
res
=
r
oot
.
Call
(
req
)
}
}
...
...
core/commands2/root.go
View file @
cac8844b
...
...
@@ -56,8 +56,6 @@ var rootSubcommands = map[string]*cmds.Command{
"cat"
:
catCmd
,
"ls"
:
lsCmd
,
"commands"
:
commandsCmd
,
"init"
:
initCmd
,
"daemon"
:
daemonCmd
,
// test subcommands
// TODO: remove these when we don't need them anymore
...
...
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