1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-06-28 08:47:42 +08:00

cat and ls multifile

This commit is contained in:
Juan Batiz-Benet
2014-07-05 22:07:20 -07:00
parent 5abf3c2ae9
commit e4ee16fac1
3 changed files with 30 additions and 23 deletions

View File

@ -3,3 +3,6 @@ all: build
build:
go build
mv cli ipfs
install: build
cp ipfs /usr/local/bin/ipfs

View File

@ -25,13 +25,14 @@ func catCmd(c *commander.Command, inp []string) error {
return nil
}
// for now only hashes, no path resolution
h, err := mh.FromB58String(inp[0])
n, err := localNode()
if err != nil {
return err
}
n, err := localNode()
for _, fn := range inp {
// for now only hashes, no path resolution
h, err := mh.FromB58String(fn)
if err != nil {
return err
}
@ -42,5 +43,6 @@ func catCmd(c *commander.Command, inp []string) error {
}
u.POut("%s", nd.Data)
}
return nil
}

View File

@ -28,13 +28,14 @@ func lsCmd(c *commander.Command, inp []string) error {
return nil
}
// for now only hashes, no path resolution
h, err := mh.FromB58String(inp[0])
n, err := localNode()
if err != nil {
return err
}
n, err := localNode()
for _, fn := range inp {
// for now only hashes, no path resolution
h, err := mh.FromB58String(fn)
if err != nil {
return err
}
@ -47,5 +48,6 @@ func lsCmd(c *commander.Command, inp []string) error {
for _, link := range nd.Links {
u.POut("%s %d %s\n", link.Hash.B58String(), link.Size, link.Name)
}
}
return nil
}