toArgumentList method

List<String> toArgumentList()

Converts all options to a list of command line arguments

Implementation

List<String> toArgumentList() {
  final List<String> result = [];

  // Add system properties (-D options)
  _systemProperties.forEach((key, value) {
    // Escape spaces in paths
    final escapedValue = value.contains(' ') ? '"$value"' : value;
    result.add('-D$key=$escapedValue');
  });

  // Add JVM options (-X options)
  result.addAll(_jvmOptions);

  // Add stay option if enabled
  if (_stay) {
    result.add('-stay');
  }

  // Add regular arguments at the end
  result.addAll(_arguments);

  return result;
}