processes() improved command parsing

This commit is contained in:
Sebastian Hildebrandt 2022-06-24 18:59:52 +02:00
parent a11719984f
commit fdcf9c707e

View File

@ -589,9 +589,13 @@ function processes(callback) {
const p1 = fullcommand.indexOf('('); const p1 = fullcommand.indexOf('(');
const p2 = fullcommand.indexOf(')'); const p2 = fullcommand.indexOf(')');
const p3 = fullcommand.indexOf('/'); const p3 = fullcommand.indexOf('/');
const p4 = fullcommand.indexOf(':');
if (p1 < p2 && p1 < p3 && p3 < p2) { if (p1 < p2 && p1 < p3 && p3 < p2) {
command = fullcommand.split(' ')[0]; command = fullcommand.split(' ')[0];
command = command.replace(/:/g, ''); command = command.replace(/:/g, '');
} else {
if (p4 > 0) {
command = fullcommand.split(' ')[0];
} else { } else {
// try to figure out where parameter starts // try to figure out where parameter starts
let firstParamPos = fullcommand.indexOf(' -'); let firstParamPos = fullcommand.indexOf(' -');
@ -621,6 +625,7 @@ function processes(callback) {
params = tmpParams.trim(); params = tmpParams.trim();
} }
} }
}
} }