Skip to content

Commit 702b765

Browse files
fix: show a helpful message when ganache instances is executed without a subcommand (ConsenSys-archive#4368)
Co-authored-by: David Murdoch <187813+davidmurdoch@users.noreply.github.com>
1 parent 9bdd38c commit 702b765

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

src/packages/cli/src/args.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,9 +281,17 @@ export default function (
281281
}
282282
)
283283
.version(false);
284+
},
285+
function () {
286+
// this handler executes when `ganache instances` is called without a subcommand
287+
const command = chalk`{hex("${TruffleColors.porsche}") ganache instances}`;
288+
console.log(`Missing subcommand for ${command}.`);
289+
console.log();
290+
yargs.showHelp();
291+
yargs.exit(1, new Error("No subcommand provided"));
284292
}
285293
)
286-
.showHelpOnFail(false, "Specify -? or --help for available options")
294+
.showHelpOnFail(false)
287295
.alias("help", "?")
288296
.wrap(wrapWidth)
289297
.version(version);

0 commit comments

Comments
 (0)