Skip to content
This repository has been archived by the owner on Aug 3, 2023. It is now read-only.

Commit

Permalink
Add namespace and binding arguments to bucket
Browse files Browse the repository at this point in the history
  • Loading branch information
EverlastingBugstopper committed Sep 16, 2019
1 parent 6ac6604 commit 9b81b2a
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 24 deletions.
16 changes: 12 additions & 4 deletions docs/content/kv_commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -340,8 +340,12 @@ Walks the given directory and runs a bulk upload, using the path to an asset as
#### Usage
```sh
$ wrangler kv:bucket upload f7b02e7fc70443149ac906dd81ec1791 ./public
```console
$ wrangler kv:bucket upload --binding MY_KV ./public
```
```console
$ wrangler kv:bucket upload --namespace-id f7b02e7fc70443149ac906dd81ec1791 ./public
```
### `delete`
Expand All @@ -350,6 +354,10 @@ Walks the given directory and runs a bulk delete, using the paths to assets as t
#### Usage
```sh
$ wrangler kv:bucket upload f7b02e7fc70443149ac906dd81ec1791 ./public
```console
$ wrangler kv:bucket delete --binding MY_KV
```
```console
$ wrangler kv:bucket delete --namespace-id f7b02e7fc70443149ac906dd81ec1791
```
31 changes: 11 additions & 20 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -241,42 +241,33 @@ fn run() -> Result<(), failure::Error> {
"{} Use KV as bucket-style storage",
emoji::KV
))
.setting(AppSettings::SubcommandRequiredElseHelp)
.subcommand(
SubCommand::with_name("upload")
.about("Upload the contents of a directory keyed on path")
.arg(
Arg::with_name("namespace-id")
.help("The ID of the namespace this action applies to")
.required(true)
// .short("n")
// .long("namespace-id")
// .value_name("<ID>")
// .takes_value(true)
)
.arg(kv_binding_arg.clone())
.arg(kv_namespace_id_arg.clone())
.group(kv_namespace_specifier_group.clone())
.arg(environment_arg.clone())
.arg(
Arg::with_name("path")
.help("the directory to be uploaded to KV")
.required(true)
.index(2),
.index(1),
)
)
.subcommand(
SubCommand::with_name("delete")
.about("Delete the contents of a directory keyed on path")
.arg(
Arg::with_name("namespace-id")
.help("The ID of the namespace this action applies to")
.required(true)
// .short("n")
// .long("namespace-id")
// .value_name("<ID>")
// .takes_value(true)
)
.arg(kv_binding_arg.clone())
.arg(kv_namespace_id_arg.clone())
.group(kv_namespace_specifier_group.clone())
.arg(environment_arg.clone())
.arg(
Arg::with_name("path")
.help("the directory to be deleted from KV")
.required(true)
.index(2),
.index(1),
)
)
)
Expand Down

0 comments on commit 9b81b2a

Please sign in to comment.