parseArgs function
Implementation
Map<String, List<String>> parseArgs(Iterable<String> args) {
final argsMap = <String, List<String>>{};
String? currentKey;
for (final arg in args) {
if (arg.startsWith('-')) {
currentKey = arg;
argsMap[currentKey] = [];
} else if (currentKey != null) {
argsMap[currentKey]!.add(arg);
}
}
return argsMap;
}