From 94cd435677699e19bc64bc079808455394ec0c3b Mon Sep 17 00:00:00 2001 From: Gleb Bahmutov Date: Sat, 21 Dec 2013 15:43:32 -0500 Subject: [PATCH] better usage message --- bin/cli.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/bin/cli.js b/bin/cli.js index 1e1cf71..8855e9a 100755 --- a/bin/cli.js +++ b/bin/cli.js @@ -61,8 +61,13 @@ program .option('-f --file ', 'load db from a js or json file') .option('-u --url ', 'load db from a URL') .option('-p --port [port]', 'server port') - .option('--read-only', 'read only mode') - .parse(process.argv); + .option('--read-only', 'read only mode'); + +program.on('--help', function () { + console.log(pkg.name, '[options] filename.json or filename.js or json ULR'); +}); + +program.parse(process.argv); if (program.port) options.port = program.port; if (program.readOnly) options.readOnly = true;