frontpage/lib/commands.ts

7 lines
290 B
TypeScript
Raw Normal View History

2021-12-14 23:45:00 +01:00
const commandList = ["about", "navigate", "external", "help", "ed", "nano"];
2021-12-14 23:08:18 +01:00
2021-12-15 18:56:32 +01:00
export function commandCompletion(input: string): string[] {
if (input === "") return [];
const candidates = commandList.filter((cmd) => cmd.substring(0, input.length) === input);
return candidates;
2021-12-14 23:08:18 +01:00
}