argsForNestedWorkspace function

List<String> argsForNestedWorkspace(
  1. List<String> args
)

args for a run in a nested workspace (-w): without the scan roots (-s / --scan), which name folders of this run; the nested run scans from its own workspace.

Implementation

List<String> argsForNestedWorkspace(List<String> args) {
  final result = <String>[];
  for (var i = 0; i < args.length; i++) {
    final arg = args[i];
    if (arg == '-s' || arg == '--scan') {
      i++; // and its value
      continue;
    }
    if (arg.startsWith('--scan=') || arg.startsWith('-s=')) continue;
    result.add(arg);
  }
  return result;
}