Skip to content
This repository has been 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
merged 3 commits into from
Apr 26, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)
davidmurdoch marked this conversation as resolved.
Show resolved Hide resolved
.alias("help", "?")
.wrap(wrapWidth)
.version(version);
Expand Down