jobsOverride static method

int? jobsOverride(
  1. List<String> arguments
)

Implementation

static int? jobsOverride(List<String> arguments) {
  String? value;
  for (final arg in arguments) {
    if (arg.startsWith('--jobs=')) {
      value = arg.substring('--jobs='.length);
    }
  }
  if (value == null || value.isEmpty || value == 'auto') return null;
  final jobs = int.tryParse(value);
  if (jobs == null || jobs <= 0) {
    stderr.writeln(
      'Invalid --jobs value "$value". Use a positive integer, auto, or 1 to disable parallelism.',
    );
    exit(2);
  }
  return jobs;
}