From 4ae4c3cceabc70df92cebb8e629a332f881a680f Mon Sep 17 00:00:00 2001 From: Sam Roberts Date: Thu, 4 Apr 2019 15:21:07 -0700 Subject: [PATCH] Fix parsing of command line, so usage works Documented CLI of ./branch-diff.js --simple master fix-cli-flags doesn't work, minimist assumes master is the value of `--simple` option, it needs to be told about options that don't take values. --- branch-diff.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/branch-diff.js b/branch-diff.js index 4a5ac5f..c144949 100755 --- a/branch-diff.js +++ b/branch-diff.js @@ -148,7 +148,11 @@ function collect (repoPath, branch, startCommit, endRef) { module.exports = branchDiff if (require.main === module) { - let argv = require('minimist')(process.argv.slice(2)) + const config = { + boolean: ['version', 'group', 'patch-only', 'simple', 'filter-release', + 'reverse'], + }; + let argv = require('minimist')(process.argv.slice(2), config) , branch1 = argv._[0] , branch2 = argv._[1] , format = argv.format