processes() improved command parsing
This commit is contained in:
parent
aa09172366
commit
a11719984f
@ -586,6 +586,13 @@ function processes(callback) {
|
|||||||
if (fullcommand.substr(fullcommand.length - 1) === ']') { fullcommand = fullcommand.slice(0, -1); }
|
if (fullcommand.substr(fullcommand.length - 1) === ']') { fullcommand = fullcommand.slice(0, -1); }
|
||||||
if (fullcommand.substr(0, 1) === '[') { command = fullcommand.substring(1); }
|
if (fullcommand.substr(0, 1) === '[') { command = fullcommand.substring(1); }
|
||||||
else {
|
else {
|
||||||
|
const p1 = fullcommand.indexOf('(');
|
||||||
|
const p2 = fullcommand.indexOf(')');
|
||||||
|
const p3 = fullcommand.indexOf('/');
|
||||||
|
if (p1 < p2 && p1 < p3 && p3 < p2) {
|
||||||
|
command = fullcommand.split(' ')[0];
|
||||||
|
command = command.replace(/:/g, '');
|
||||||
|
} else {
|
||||||
// try to figure out where parameter starts
|
// try to figure out where parameter starts
|
||||||
let firstParamPos = fullcommand.indexOf(' -');
|
let firstParamPos = fullcommand.indexOf(' -');
|
||||||
let firstParamPathPos = fullcommand.indexOf(' /');
|
let firstParamPathPos = fullcommand.indexOf(' /');
|
||||||
@ -615,6 +622,8 @@ function processes(callback) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
return ({
|
return ({
|
||||||
pid: pid,
|
pid: pid,
|
||||||
parentPid: ppid,
|
parentPid: ppid,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user