提交 ceaa7528 作者: vyzo 提交者: Łukasz Magiera

namecache: obey conventional order in commands/follow

License: MIT
Signed-off-by: 's avatarvyzo <vyzo@hackzen.org>
上级 2969f795
...@@ -37,6 +37,9 @@ var ipnsFollowAddCmd = &cmds.Command{ ...@@ -37,6 +37,9 @@ var ipnsFollowAddCmd = &cmds.Command{
Follows an IPNS name by periodically resolving in the backround. Follows an IPNS name by periodically resolving in the backround.
`, `,
}, },
Arguments: []cmdkit.Argument{
cmdkit.StringArg("name", true, false, "IPNS Name to follow."),
},
Run: func(req cmds.Request, res cmds.Response) { Run: func(req cmds.Request, res cmds.Response) {
n, err := req.InvocContext().GetNode() n, err := req.InvocContext().GetNode()
if err != nil { if err != nil {
...@@ -53,9 +56,6 @@ Follows an IPNS name by periodically resolving in the backround. ...@@ -53,9 +56,6 @@ Follows an IPNS name by periodically resolving in the backround.
res.SetOutput(&ipnsFollowResult{true}) res.SetOutput(&ipnsFollowResult{true})
}, },
Arguments: []cmdkit.Argument{
cmdkit.StringArg("name", true, false, "IPNS Name to follow."),
},
Type: ipnsFollowResult{}, Type: ipnsFollowResult{},
Marshalers: cmds.MarshalerMap{ Marshalers: cmds.MarshalerMap{
cmds.Text: marshalFollowResult, cmds.Text: marshalFollowResult,
...@@ -70,6 +70,9 @@ Follows an IPNS name by periodically resolving and recursively ...@@ -70,6 +70,9 @@ Follows an IPNS name by periodically resolving and recursively
pinning in the backround. pinning in the backround.
`, `,
}, },
Arguments: []cmdkit.Argument{
cmdkit.StringArg("name", true, false, "IPNS Name to follow."),
},
Run: func(req cmds.Request, res cmds.Response) { Run: func(req cmds.Request, res cmds.Response) {
n, err := req.InvocContext().GetNode() n, err := req.InvocContext().GetNode()
if err != nil { if err != nil {
...@@ -86,9 +89,6 @@ pinning in the backround. ...@@ -86,9 +89,6 @@ pinning in the backround.
res.SetOutput(&ipnsFollowResult{true}) res.SetOutput(&ipnsFollowResult{true})
}, },
Arguments: []cmdkit.Argument{
cmdkit.StringArg("name", true, false, "IPNS Name to follow."),
},
Type: ipnsFollowResult{}, Type: ipnsFollowResult{},
Marshalers: cmds.MarshalerMap{ Marshalers: cmds.MarshalerMap{
cmds.Text: marshalFollowResult, cmds.Text: marshalFollowResult,
...@@ -123,6 +123,9 @@ var ipnsFollowCancelCmd = &cmds.Command{ ...@@ -123,6 +123,9 @@ var ipnsFollowCancelCmd = &cmds.Command{
Helptext: cmdkit.HelpText{ Helptext: cmdkit.HelpText{
Tagline: "Cancels a follow", Tagline: "Cancels a follow",
}, },
Arguments: []cmdkit.Argument{
cmdkit.StringArg("name", true, false, "Name follow to cancel."),
},
Run: func(req cmds.Request, res cmds.Response) { Run: func(req cmds.Request, res cmds.Response) {
n, err := req.InvocContext().GetNode() n, err := req.InvocContext().GetNode()
if err != nil { if err != nil {
...@@ -139,9 +142,6 @@ var ipnsFollowCancelCmd = &cmds.Command{ ...@@ -139,9 +142,6 @@ var ipnsFollowCancelCmd = &cmds.Command{
res.SetOutput(&ipnsFollowResult{true}) res.SetOutput(&ipnsFollowResult{true})
}, },
Arguments: []cmdkit.Argument{
cmdkit.StringArg("name", true, false, "Name follow to cancel."),
},
Type: ipnsFollowResult{}, Type: ipnsFollowResult{},
Marshalers: cmds.MarshalerMap{ Marshalers: cmds.MarshalerMap{
cmds.Text: marshalFollowResult, cmds.Text: marshalFollowResult,
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论