diff options
author | Lewis Marshall <lewis@lmars.net> | 2017-04-05 06:20:07 +0800 |
---|---|---|
committer | Felix Lange <fjl@users.noreply.github.com> | 2017-04-05 06:20:07 +0800 |
commit | b319f027a0be232a9cb307336b0349b36737c7f1 (patch) | |
tree | a17c7dc775c270aea9acdabc8e13292b3c2ae958 /cmd/swarm/main.go | |
parent | 09777952ee476ff80d4b6e63b5041ff5ca0e441b (diff) | |
download | dexon-b319f027a0be232a9cb307336b0349b36737c7f1.tar.gz dexon-b319f027a0be232a9cb307336b0349b36737c7f1.tar.zst dexon-b319f027a0be232a9cb307336b0349b36737c7f1.zip |
cmd/swarm, swarm/api/client: add HTTP API client and 'swarm ls' command (#3742)
This adds a swarm ls command which lists files and directories stored in a
manifest. Rather than listing all files, it uses "directory prefixes" in case there are a
lot of files in a manifest but you just want to traverse it.
This also includes some refactoring to the tests and the introduction of a
swarm/api/client package to make things easier to test.
Diffstat (limited to 'cmd/swarm/main.go')
-rw-r--r-- | cmd/swarm/main.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/cmd/swarm/main.go b/cmd/swarm/main.go index 3c82497e5..731c300f8 100644 --- a/cmd/swarm/main.go +++ b/cmd/swarm/main.go @@ -148,6 +148,15 @@ The output of this command is supposed to be machine-readable. `, }, { + Action: list, + Name: "ls", + Usage: "list files and directories contained in a manifest", + ArgsUsage: " <manifest> [<prefix>]", + Description: ` +Lists files and directories contained in a manifest. +`, + }, + { Action: hash, Name: "hash", Usage: "print the swarm hash of a file or directory", |