aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/swarm/manifest.go
diff options
context:
space:
mode:
authorElad <theman@elad.im>2018-10-12 20:51:38 +0800
committerAnton Evangelatov <anton.evangelatov@gmail.com>2018-10-12 20:51:38 +0800
commit4868964bb99facd8cc6149626023e64db14a6742 (patch)
tree858bfaddcb1f1381e3bb2e0dd4c72aed397e621d /cmd/swarm/manifest.go
parent6f607de5d590ff2fbe8798b04e5924be3b7ca0b4 (diff)
downloadgo-tangerine-4868964bb99facd8cc6149626023e64db14a6742.tar.gz
go-tangerine-4868964bb99facd8cc6149626023e64db14a6742.tar.zst
go-tangerine-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.go34
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.