This repository has been archived by the owner on Feb 26, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 682
fix: show a helpful message when ganache instances
is executed without a subcommand
#4368
Merged
Conversation
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
jeffsmale90
commented
Apr 21, 2023
src/packages/cli/src/args.ts
Outdated
Comment on lines
287
to
291
const command = chalk`{hex("${TruffleColors.porsche}") ganache instances}`; | ||
console.log(`${command} requires a subcommand:`); | ||
console.log(); | ||
yargs.showHelp(); | ||
yargs.exit(1, new Error("No subcommand provided")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not my favourite. I'd rather use the .demandCommand()
function, but this doesn't allow us to output the instances
helptext, which I think is super useful.
This is also not easily testable, as it terminates the process inside of yargs :(
davidmurdoch
suggested changes
Apr 25, 2023
Co-authored-by: David Murdoch <[email protected]>
Deploying with Cloudflare Pages
|
davidmurdoch
approved these changes
Apr 26, 2023
ghost
reviewed
Apr 30, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix/instances_command_help
This was referenced Sep 23, 2023
This was referenced Nov 23, 2023
This was referenced Dec 2, 2023
This was referenced Dec 12, 2023
This was referenced Dec 31, 2023
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When
ganache instances
is executed, a subcommand must be provided.Previously an unhelpful error was thrown, with this fix we output a simple error message, followed by the the help text for
ganache instances
.fixes: #4360