diff options
author | Elad <theman@elad.im> | 2018-10-12 20:51:38 +0800 |
---|---|---|
committer | Anton Evangelatov <anton.evangelatov@gmail.com> | 2018-10-12 20:51:38 +0800 |
commit | 4868964bb99facd8cc6149626023e64db14a6742 (patch) | |
tree | 858bfaddcb1f1381e3bb2e0dd4c72aed397e621d /cmd/swarm/manifest.go | |
parent | 6f607de5d590ff2fbe8798b04e5924be3b7ca0b4 (diff) | |
download | dexon-4868964bb99facd8cc6149626023e64db14a6742.tar dexon-4868964bb99facd8cc6149626023e64db14a6742.tar.gz dexon-4868964bb99facd8cc6149626023e64db14a6742.tar.bz2 dexon-4868964bb99facd8cc6149626023e64db14a6742.tar.lz dexon-4868964bb99facd8cc6149626023e64db14a6742.tar.xz dexon-4868964bb99facd8cc6149626023e64db14a6742.tar.zst dexon-4868964bb99facd8cc6149626023e64db14a6742.zip |
cmd/swarm: split flags and cli command declarations to the relevant files (#17896)
Diffstat (limited to 'cmd/swarm/manifest.go')
-rw-r--r-- | cmd/swarm/manifest.go | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/cmd/swarm/manifest.go b/cmd/swarm/manifest.go index 0216ffc1d..312c72fa2 100644 --- a/cmd/swarm/manifest.go +++ b/cmd/swarm/manifest.go @@ -28,6 +28,40 @@ import ( "gopkg.in/urfave/cli.v1" ) +var manifestCommand = cli.Command{ + Name: "manifest", + CustomHelpTemplate: helpTemplate, + Usage: "perform operations on swarm manifests", + ArgsUsage: "COMMAND", + Description: "Updates a MANIFEST by adding/removing/updating the hash of a path.\nCOMMAND could be: add, update, remove", + Subcommands: []cli.Command{ + { + Action: manifestAdd, + CustomHelpTemplate: helpTemplate, + Name: "add", + Usage: "add a new path to the manifest", + ArgsUsage: "<MANIFEST> <path> <hash>", + Description: "Adds a new path to the manifest", + }, + { + Action: manifestUpdate, + CustomHelpTemplate: helpTemplate, + Name: "update", + Usage: "update the hash for an already existing path in the manifest", + ArgsUsage: "<MANIFEST> <path> <newhash>", + Description: "Update the hash for an already existing path in the manifest", + }, + { + Action: manifestRemove, + CustomHelpTemplate: helpTemplate, + Name: "remove", + Usage: "removes a path from the manifest", + ArgsUsage: "<MANIFEST> <path>", + Description: "Removes a path from the manifest", + }, + }, +} + // manifestAdd adds a new entry to the manifest at the given path. // New entry hash, the last argument, must be the hash of a manifest // with only one entry, which meta-data will be added to the original manifest. |