Commit 9356e1a0 authored by Matt Bell's avatar Matt Bell Committed by Juan Batiz-Benet

cmd/ipfs: Moved private commands to core/commands2

parent fb125308
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,
},
}
......@@ -7,7 +7,7 @@ import (
uio "github.com/jbenet/go-ipfs/unixfs/io"
)
var cat = &cmds.Command{
var catCmd = &cmds.Command{
Help: "TODO",
Run: func(res cmds.Response, req cmds.Request) {
node := req.Context().Node
......
package main
package commands
import (
"fmt"
......@@ -14,6 +14,7 @@ import (
)
var daemonCmd = &cmds.Command{
Private: true,
Options: []cmds.Option{},
Help: "TODO",
Subcommands: map[string]*cmds.Command{},
......
package main
package commands
import (
"encoding/base64"
......@@ -15,6 +15,7 @@ import (
)
var initCmd = &cmds.Command{
Private: true,
Options: []cmds.Option{
cmds.Option{[]string{"bits", "b"}, cmds.Int},
cmds.Option{[]string{"passphrase", "p"}, cmds.String},
......
......@@ -20,7 +20,7 @@ type LsOutput struct {
Objects []Object
}
var ls = &cmds.Command{
var lsCmd = &cmds.Command{
Help: "TODO",
Run: func(res cmds.Response, req cmds.Request) {
node := req.Context().Node
......
......@@ -51,8 +51,9 @@ Plumbing commands:
Use "ipfs help <command>" for more information about a command.
`,
Subcommands: map[string]*cmds.Command{
"cat": cat,
"ls": ls,
"cat": catCmd,
"ls": lsCmd,
"init": initCmd,
// test subcommands
// TODO: remove these when we don't need them anymore
......@@ -106,3 +107,7 @@ Use "ipfs help <command>" for more information about a command.
},
},
}
func init() {
Root.Subcommands["daemon"] = daemonCmd
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment