-
Notifications
You must be signed in to change notification settings - Fork 770
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: display the correct help information when a subcommand is invalid (
#1052) Previously, when an invalid subcommand was used, such as `wrangler r2 foo`, the help that was displayed showed the top-level commands prefixed by the command in used. E.g. ``` wrangler r2 init [name] 📥 Create a wrangler.toml configuration file wrangler r2 dev [script] 👂 Start a local server for developing your worker wrangler r2 publish [script] 🆙 Publish your Worker to Cloudflare. ... ``` Now the correct command help is displayed: ``` $ wrangler r2 foo ✘ [ERROR] Unknown argument: foo wrangler r2 📦 Interact with an R2 store Commands: wrangler r2 bucket Manage R2 buckets Flags: -c, --config Path to .toml configuration file [string] -h, --help Show help [boolean] -v, --version Show version number [boolean] ``` Fixes #871
- Loading branch information
1 parent
6791703
commit 233eef2
Showing
6 changed files
with
163 additions
and
121 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
--- | ||
"wrangler": patch | ||
--- | ||
|
||
fix: display the correct help information when a subcommand is invalid | ||
|
||
Previously, when an invalid subcommand was used, such as `wrangler r2 foo`, | ||
the help that was displayed showed the top-level commands prefixed by the command in used. | ||
E.g. | ||
|
||
``` | ||
wrangler r2 init [name] 📥 Create a wrangler.toml configuration file | ||
wrangler r2 dev [script] 👂 Start a local server for developing your worker | ||
wrangler r2 publish [script] 🆙 Publish your Worker to Cloudflare. | ||
... | ||
``` | ||
|
||
Now the correct command help is displayed: | ||
|
||
``` | ||
$ wrangler r2 foo | ||
✘ [ERROR] Unknown argument: foo | ||
wrangler r2 | ||
📦 Interact with an R2 store | ||
Commands: | ||
wrangler r2 bucket Manage R2 buckets | ||
Flags: | ||
-c, --config Path to .toml configuration file [string] | ||
-h, --help Show help [boolean] | ||
-v, --version Show version number [boolean] | ||
``` | ||
|
||
Fixes #871 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.