This repository was archived by the owner on Feb 26, 2024. It is now read-only.
fix: show a helpful message when ganache instances is executed without a subcommand#4368
Merged
jeffsmale90 merged 3 commits intodevelopfrom Apr 26, 2023
Merged
fix: show a helpful message when ganache instances is executed without a subcommand#4368jeffsmale90 merged 3 commits intodevelopfrom
ganache instances is executed without a subcommand#4368jeffsmale90 merged 3 commits intodevelopfrom
Conversation
jeffsmale90
commented
Apr 21, 2023
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")); |
Contributor
Author
There was a problem hiding this comment.
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 <187813+davidmurdoch@users.noreply.github.com>
Deploying with
|
| Latest commit: |
7ab20ae
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://1caba4dd.ganache.pages.dev |
| Branch Preview URL: | https://fix-instances-command-help.ganache.pages.dev |
davidmurdoch
approved these changes
Apr 26, 2023
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
This file contains hidden or 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
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 instancesis 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