Add autocomplete to help command

This commit is contained in:
nickofolas 2022-01-14 15:25:30 -06:00
parent 62ac7f7d17
commit d136198738

@ -6,6 +6,7 @@ import { DarkWebItems } from "../DarkWeb/DarkWebItems";
import { IPlayer } from "../PersonObjects/IPlayer"; import { IPlayer } from "../PersonObjects/IPlayer";
import { GetServer, GetAllServers } from "../Server/AllServers"; import { GetServer, GetAllServers } from "../Server/AllServers";
import { ParseCommand, ParseCommands } from "./Parser"; import { ParseCommand, ParseCommands } from "./Parser";
import { HelpTexts } from "./HelpText";
import { isScriptFilename } from "../Script/isScriptFilename"; import { isScriptFilename } from "../Script/isScriptFilename";
import { compile } from "../NetscriptJSEvaluator"; import { compile } from "../NetscriptJSEvaluator";
import { Flags } from "../NetscriptFunctions/Flags"; import { Flags } from "../NetscriptFunctions/Flags";
@ -396,5 +397,11 @@ export async function determineAllPossibilitiesForTabCompletion(
addAllDirectories(); addAllDirectories();
} }
if (isCommand("help")) {
// Get names from here instead of commands array because some
// undocumented/nonexistent commands are in the array
return Object.keys(HelpTexts);
}
return allPos; return allPos;
} }