withArguments function

String withArguments(
  1. String command,
  2. List<String> arguments, {
  3. bool? windows,
})

command followed by arguments, each quoted for the shell so it reaches the script as one argument.

Implementation

String withArguments(String command, List<String> arguments, {bool? windows}) {
  if (arguments.isEmpty) {
    return command;
  }
  final quote = (windows ?? Platform.isWindows) ? _quoteCmd : shellQuote;
  return [command, ...arguments.map(quote)].join(' ');
}