mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-10-21 05:01:26 -07:00
fix: reject extra positional args after -- in launcher
This commit is contained in:
1 parent
804755bd3d
commit
30c363375a
1 file changed
+9
-1
@@ -2466,7 +2466,11 @@ function parseArgs(
|
||||
}
|
||||
|
||||
const positional = argv.slice(i);
|
||||
if (positional.length > 0 && !parsed.target && !parsed.directory) {
|
||||
if (positional.length > 0) {
|
||||
if (parsed.target || parsed.directory) {
|
||||
fail(`Unexpected positional argument: ${positional[0]}`);
|
||||
}
|
||||
|
||||
const target = positional[0];
|
||||
if (isUrlTarget(target)) {
|
||||
parsed.target = target;
|
||||
@@ -2485,6 +2489,10 @@ function parseArgs(
|
||||
fail(`Not a file, directory, or supported URL: ${target}`);
|
||||
}
|
||||
}
|
||||
|
||||
if (positional.length > 1) {
|
||||
fail(`Unexpected positional argument: ${positional[1]}`);
|
||||
}
|
||||
}
|
||||
|
||||
return parsed;
|
||||
|
||||
Reference in new issue
Block a user