Commit 2915007c authored by Matt Bell's avatar Matt Bell Committed by Juan Batiz-Benet

commands: Changed Request arguments to a []interface{}

parent c70ca4dd
...@@ -13,7 +13,8 @@ var catCmd = &cmds.Command{ ...@@ -13,7 +13,8 @@ var catCmd = &cmds.Command{
node := req.Context().Node node := req.Context().Node
readers := make([]io.Reader, 0, len(req.Arguments())) readers := make([]io.Reader, 0, len(req.Arguments()))
for _, path := range req.Arguments() { for _, arg := range req.Arguments() {
path := arg.(string)
dagnode, err := node.Resolver.ResolvePath(path) dagnode, err := node.Resolver.ResolvePath(path)
if err != nil { if err != nil {
res.SetError(err, cmds.ErrNormal) res.SetError(err, cmds.ErrNormal)
......
...@@ -26,7 +26,8 @@ var lsCmd = &cmds.Command{ ...@@ -26,7 +26,8 @@ var lsCmd = &cmds.Command{
node := req.Context().Node node := req.Context().Node
output := make([]Object, len(req.Arguments())) output := make([]Object, len(req.Arguments()))
for i, path := range req.Arguments() { for i, arg := range req.Arguments() {
path := arg.(string)
dagnode, err := node.Resolver.ResolvePath(path) dagnode, err := node.Resolver.ResolvePath(path)
if err != nil { if err != nil {
res.SetError(err, cmds.ErrNormal) res.SetError(err, cmds.ErrNormal)
......
...@@ -30,12 +30,12 @@ var publishCmd = &cmds.Command{ ...@@ -30,12 +30,12 @@ var publishCmd = &cmds.Command{
switch len(args) { switch len(args) {
case 2: case 2:
// name = args[0] // name = args[0]
ref = args[1] ref = args[1].(string)
res.SetError(errors.New("keychains not yet implemented"), cmds.ErrNormal) res.SetError(errors.New("keychains not yet implemented"), cmds.ErrNormal)
return return
case 1: case 1:
// name = n.Identity.ID.String() // name = n.Identity.ID.String()
ref = args[0] ref = args[0].(string)
default: default:
res.SetError(fmt.Errorf("Publish expects 1 or 2 args; got %d.", len(args)), cmds.ErrClient) res.SetError(fmt.Errorf("Publish expects 1 or 2 args; got %d.", len(args)), cmds.ErrClient)
......
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