Add a few hidden commands and rewording

This commit is contained in:
2022-07-30 15:45:09 +02:00
parent 54b92fed0b
commit 59538ef110
2 changed files with 54 additions and 14 deletions

View File

@@ -13,7 +13,7 @@ export class CommandInterface {
static commandCompletion(input: string): string[] {
if (input === "") return [];
const candidates = commandList.filter(cmd => cmd.name.startsWith(input)).map(cmd => cmd.name);
const candidates = commandList.filter(cmd => !cmd.hidden && cmd.name.startsWith(input)).map(cmd => cmd.name);
return candidates;
}
@@ -24,7 +24,7 @@ export class CommandInterface {
if (!cmd) return [`$ ${command}`].concat(this.illegalCommand(command));
const parsed = this.seperateFlags(args.splice(1));
const result = parsed.flags.includes("--help") ? printSyntax(cmd) : cmd.execute(parsed.flags, parsed.subcmds, command, this);
const result = parsed.flags.includes("--help") || parsed.flags.includes("-?") ? printSyntax(cmd) : cmd.execute(parsed.flags, parsed.subcmds, command, this);
return [`$ ${command}`].concat(result);
}