Skip to content

Commit cd9fd3e

Browse files
committed
Corrected args handling for quote enclosed values
1 parent e2b5429 commit cd9fd3e

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

packages/cli/bin/heroku-repl.js

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,20 @@ class HerokuRepl {
200200
this.#history.push(input)
201201
this.#historyStream?.write(input + '\n')
202202

203-
const [command, ...args] = input.split(' ')
203+
const {_: [command, ...positionalArgs], ...flags} = yargs(input, {
204+
configuration: {
205+
'camel-case-expansion': false,
206+
'boolean-negation': false,
207+
},
208+
})
209+
const args = Object.entries(flags).flatMap(([key, value]) => {
210+
if (typeof value === 'string') {
211+
return [`--${key}`, value]
212+
}
213+
214+
return [`--${key}`]
215+
}).concat(positionalArgs)
216+
204217
if (command === 'exit') {
205218
process.exit(0)
206219
}

0 commit comments

Comments
 (0)