aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/swarm/upload.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/upload.go
parent6f607de5d590ff2fbe8798b04e5924be3b7ca0b4 (diff)
downloaddexon-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/upload.go')
-rw-r--r--cmd/swarm/upload.go11
1 files changed, 10 insertions, 1 deletions
diff --git a/cmd/swarm/upload.go b/cmd/swarm/upload.go
index 2225127cf..0dbe896e2 100644
--- a/cmd/swarm/upload.go
+++ b/cmd/swarm/upload.go
@@ -34,8 +34,17 @@ import (
"gopkg.in/urfave/cli.v1"
)
-func upload(ctx *cli.Context) {
+var upCommand = cli.Command{
+ Action: upload,
+ CustomHelpTemplate: helpTemplate,
+ Name: "up",
+ Usage: "uploads a file or directory to swarm using the HTTP API",
+ ArgsUsage: "<file>",
+ Flags: []cli.Flag{SwarmEncryptedFlag},
+ Description: "uploads a file or directory to swarm using the HTTP API and prints the root hash",
+}
+func upload(ctx *cli.Context) {
args := ctx.Args()
var (
bzzapi = strings.TrimRight(ctx.GlobalString(SwarmApiFlag.Name), "/")