mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-22 23:53:48 +01:00
commit
e6b84a73b2
@ -17,7 +17,7 @@ export function ls(
|
|||||||
terminal.error("Incorrect usage of ls command. Usage: ls [dir] [| grep pattern]");
|
terminal.error("Incorrect usage of ls command. Usage: ls [dir] [| grep pattern]");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (numArgs > 5 || numArgs === 3) {
|
if (numArgs > 4 || numArgs === 2) {
|
||||||
return incorrectUsage();
|
return incorrectUsage();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -30,12 +30,12 @@ export function ls(
|
|||||||
prefix += "/";
|
prefix += "/";
|
||||||
}
|
}
|
||||||
|
|
||||||
// If there are 4+ arguments, then the last 3 must be for grep
|
// If there are 3+ arguments, then the last 3 must be for grep
|
||||||
if (numArgs >= 4) {
|
if (numArgs >= 3) {
|
||||||
if (args[numArgs - 1] !== "grep" || args[numArgs - 2] !== "|") {
|
if (args[numArgs - 2] !== "grep" || args[numArgs - 3] !== "|") {
|
||||||
return incorrectUsage();
|
return incorrectUsage();
|
||||||
}
|
}
|
||||||
filter = args[numArgs] + "";
|
filter = args[numArgs - 1] + "";
|
||||||
}
|
}
|
||||||
|
|
||||||
// If the second argument is not a pipe, then it must be for listing a directory
|
// If the second argument is not a pipe, then it must be for listing a directory
|
||||||
|
Loading…
Reference in New Issue
Block a user