ww output: match Go exact -o parsing

This commit is contained in:
2026-08-22 01:59:02 +09:00
parent 4b9968e4e6
commit d61805262e
7 changed files with 701 additions and 36 deletions

View File

@@ -2055,16 +2055,20 @@ export fn packagecommand(args: []str) int = {
i += 1;
continue;
};
if (strings.compare(a, "-o") == 0) {
if (strings.compare(a, "-o") == 0
|| strings.compare(a, "--o") == 0) {
if (i + 1 >= args.len) { pkgusage(); return 2; };
outname = args[i + 1];
explicitout = true;
explicitout = outname.len != 0;
i += 2;
continue;
};
if (strings.hasprefix(a, "-o") && a.len > 2) {
outname = a[2:a.len];
explicitout = true;
if (strings.hasprefix(a, "-o=")
|| strings.hasprefix(a, "--o=")) {
let valueoff: i32 = 3;
if (a[1] == '-') { valueoff = 4; };
outname = a[valueoff:a.len];
explicitout = outname.len != 0;
i += 1;
continue;
};