75lb / object-to-spawn-args

Converts an options object to an array suitable for passing to child_process.spawn()

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support duplicate flags

vjpr opened this issue · comments

CLI's like Docker and rsync support using a flag multiple times.

Not sure the best syntax.

This is concise, but a bit confusing:

const args = {
  volume: [['foo', 'bar']]
}

Otherwise you could use an object with a "type" setting.

const args = {
  volume: {separate: true, values: ['foo', 'bar']}
}

separate, multi...something like that.


I'm thinking though that perhaps it might be neccessary to support ordering. Which in that case would mean that an array would be preferred over an object.