Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
G
go-ipfs
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
jihao
go-ipfs
Commits
cac8844b
提交
cac8844b
authored
10月 31, 2014
作者:
Matt Bell
提交者:
Juan Batiz-Benet
11月 14, 2014
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
cmd/ipfs: Reverted back to secondary CLI root command
上级
24814a41
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
24 行增加
和
12 行删除
+24
-12
daemon.go
cmd/ipfs2/daemon.go
+3
-3
init.go
cmd/ipfs2/init.go
+1
-2
ipfs.go
cmd/ipfs2/ipfs.go
+15
-0
main.go
cmd/ipfs2/main.go
+5
-5
root.go
core/commands2/root.go
+0
-2
没有找到文件。
c
ore/command
s2/daemon.go
→
c
md/ipf
s2/daemon.go
浏览文件 @
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
浏览文件 @
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
浏览文件 @
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
浏览文件 @
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
浏览文件 @
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
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论