Skip to content

Commit

Permalink
Fix a bug where rawCommand was added to global scope
Browse files Browse the repository at this point in the history
  • Loading branch information
Yord committed Jul 7, 2020
1 parent d3b6cc1 commit 633fd6b
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions src/parser/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,7 @@ function fromArgs (rawCommandNewline) {
.reduce((obj, [key, val]) => ({...obj, [key]: val}), {})
)

return ({errs, args: [opts, cmd, ...rest]}) => {
const res = fromArgsDefault({errs, args: [opts, addRawCommand(cmd), ...rest]})

const {errs: errs2, args: args2} = removeRest(res)

return {
errs: errs2,
args: {...args2, rawCommand}
}
}
return ({errs, args: [opts, cmd, ...rest]}) => removeRest(
fromArgsDefault({errs, args: [opts, addRawCommand(cmd), ...rest]})
)
}

0 comments on commit 633fd6b

Please sign in to comment.