Skip to content

Commit

Permalink
fix: discard flags after -- break
Browse files Browse the repository at this point in the history
  • Loading branch information
antongolub committed Aug 10, 2020
1 parent 2a646bc commit 4ee89e0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/main/ts/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export const invoke = (cmd: string, args: string[], cwd: string, silent= false)
}
}

export const parseFlags = minimist
export const parseFlags = (argv: string[]) => minimist(argv, {'--': true})

const checkByLists = (value: any, omitlist: any[], picklist: any[]): boolean =>
!omitlist.includes(value) && (!picklist.length || picklist.includes(value))
Expand Down
6 changes: 5 additions & 1 deletion src/test/ts/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,12 @@ describe('util', () => {
'--force',
'--audit-level=moderate',
'--only=dev',
'--',
'--bar',
'-b',
'2',
]),
['force', 'audit-level', 'only'],
['force', 'audit-level', 'only', 'bar', 'b'],
['--force', '--audit-level', 'moderate', '--only', 'dev'],
],
]
Expand Down

0 comments on commit 4ee89e0

Please sign in to comment.