Merge pull request #3361 from thelounge/xpaw/unknown-cmd-error

Display an error on unknown command
This commit is contained in:
Pavel Djundik 2019-08-13 10:28:30 +03:00 committed by GitHub
commit d7dcdd1cd4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -15,6 +15,12 @@ program
"override entries of the configuration file, must be specified for each entry that needs to be overriden",
Utils.parseConfigOptions
)
.on("command:*", () => {
log.error(
`Unknown command. See ${colors.bold("--help")} for a list of available commands.`
);
process.exit(1);
})
.on("--help", Utils.extraHelp);
// Parse options from `argv` returning `argv` void of these options.