SetupVersionsCliConfig.parse constructor

SetupVersionsCliConfig.parse(
  1. List<String> arguments
)

Parses the given arguments into a SetupVersionsCliConfig.

The comma-separated --versions option is split into a list and trimmed; every other option maps directly onto a field.

Implementation

factory SetupVersionsCliConfig.parse(List<String> arguments) {
  final parsedArgs = parser.parse(arguments);
  return SetupVersionsCliConfig(
    versions: (parsedArgs['versions'] as String)
        .split(',')
        .map((v) => v.trim())
        .toList(),
    hf: parsedArgs['hf'] as bool,
    help: parsedArgs['help'] as bool,
  );
}