function setOptToArgs(args, key, value) {
  if (Array.isArray(value)) {
    value.forEach((v) => setOptToArgs(args, key, v))
    return
  }
  if (typeof value === 'object') {
    args.push(`--${key}='${JSON.stringify(value)}'`)
    return
  }
  if (value === true) {
    args.push(`--${key}`)
  } else if (typeof value === 'string') {
    args.push(`--${key}='${value}'`)
  } else {
    args.push(`--${key}=${value}`)
  }
}
Add one or more CLI options to an array of args

Mutates `args`

@param {string[]} args - Array of args
@param {string} key - Option name
@param {any} value - Value; if array, `key` will be set multiple times
@returns {void}