Skip to content

Commit

Permalink
fix: show a helpful message when ganache instances is executed with…
Browse files Browse the repository at this point in the history
…out a subcommand (trufflesuite#4368)

Co-authored-by: David Murdoch <187813+davidmurdoch@users.noreply.github.com>
  • Loading branch information
jeffsmale90 and davidmurdoch authored Apr 26, 2023
1 parent 9bdd38c commit 702b765
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/packages/cli/src/args.ts
Original file line number Diff line number Diff line change
Expand Up @@ -281,9 +281,17 @@ export default function (
}
)
.version(false);
},
function () {
// this handler executes when `ganache instances` is called without a subcommand
const command = chalk`{hex("${TruffleColors.porsche}") ganache instances}`;
console.log(`Missing subcommand for ${command}.`);
console.log();
yargs.showHelp();
yargs.exit(1, new Error("No subcommand provided"));
}
)
.showHelpOnFail(false, "Specify -? or --help for available options")
.showHelpOnFail(false)
.alias("help", "?")
.wrap(wrapWidth)
.version(version);
Expand Down

0 comments on commit 702b765

Please sign in to comment.