diff --git a/bin/static-marks.js b/bin/static-marks.js index 0971f52..4199390 100644 --- a/bin/static-marks.js +++ b/bin/static-marks.js @@ -10,7 +10,7 @@ const importBookmarks = require("./import"); program .description(pkg.description) - .usage("[options] ") + .usage(" [options]") .version(pkg.version); // build @@ -44,6 +44,11 @@ program program.parse(process.argv); -if (program.args.length === 0) { +// eslint-disable-next-line no-underscore-dangle +const commands = program.args.filter(argument => argument._name); + +// missing/unknown subcommand +if (program.args.length === 0 || commands.length === 0) { + console.error(`Error: Missing or unknown command.\n`); program.help(); }