diff --git a/docs/content/kv_commands.md b/docs/content/kv_commands.md index 94de854d7..b6ec538e6 100644 --- a/docs/content/kv_commands.md +++ b/docs/content/kv_commands.md @@ -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` @@ -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 ``` diff --git a/src/main.rs b/src/main.rs index 29c8e56c5..0193c9742 100644 --- a/src/main.rs +++ b/src/main.rs @@ -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("") - // .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("") - // .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), ) ) )