checkVersion tag

This commit is contained in:
Ne_Eo
2024-07-22 11:14:11 +02:00
parent 79ff4f8636
commit 0cc19d482c
8 changed files with 63 additions and 63 deletions
+5 -5
View File
@@ -17,18 +17,18 @@ class ArgParser {
this.args = args;
this.options = new Map();
var copy = args.copy();
final copy = args.copy();
var i = 0;
while(copy.length > 0) {
var arg = copy.shift();
// this parses the -NAME=VALUE
if (arg.startsWith("-")) {
var key = arg.substr(1);
var isLongKey = key.startsWith("-");
final isLongKey = key.startsWith("-");
if (isLongKey) {
key = key.substr(1);
}
var split = key.split("=");
final split = key.split("=");
var longName = split.shift();
if(!isLongKey) {
// Allow -ABC to be parsed as -A -B -C
@@ -43,8 +43,8 @@ class ArgParser {
// Parse the last option with value support
}
var name = rename(longName);
var value = (split.length > 0) ? split.join("=") : null;
final name = rename(longName);
final value = (split.length > 0) ? split.join("=") : null;
options.set(name, value);
args.splice(i, 1);