Skip to content

Commit

Permalink
update cli to work with latest commander.js
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisbreiding committed Dec 10, 2019
1 parent d5bc9a0 commit 62fde51
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cli/lib/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ const spaceDelimitedArgsMsg = (flag, args) => {
}

const parseVariableOpts = (fnArgs, args) => {
const opts = fnArgs.pop()
const [opts, unknownArgs] = fnArgs

if (fnArgs.length && (opts.spec || opts.tag)) {
if ((unknownArgs && unknownArgs.length) && (opts.spec || opts.tag)) {
// this will capture space-delimited args after
// flags that could have possible multiple args
// but before the next option
Expand All @@ -72,7 +72,7 @@ const parseVariableOpts = (fnArgs, args) => {
const endIndex = nextOptOffset !== -1 ? argIndex + nextOptOffset : args.length

const maybeArgs = _.slice(args, argIndex, endIndex)
const extraArgs = _.intersection(maybeArgs, fnArgs)
const extraArgs = _.intersection(maybeArgs, unknownArgs)

if (extraArgs.length) {
opts[flag] = [opts[flag]].concat(extraArgs)
Expand Down

0 comments on commit 62fde51

Please sign in to comment.