diff --git a/src/commands/help.ts b/src/commands/help.ts new file mode 100644 index 0000000..968408c --- /dev/null +++ b/src/commands/help.ts @@ -0,0 +1,37 @@ +const helpObj = { + commands: [ + ["'about'", "Who am I?"], + ["'whoami'", "A perplexing question."], + ["'su'", ";D"], + ["'banner'", "Display the banner."], + ["'clear'", "Clear the terminal."], + ], +}; + +const createHelp = (): string[] => { + const help: string[] = []; + help.push("
"); + + helpObj.commands.forEach((ele) => { + const SPACE = " "; + let string = ""; + string += SPACE.repeat(2); + string += ""; + string += ele[0]; + string += ""; + string += SPACE.repeat(17 - ele[0].length); + string += ele[1]; + help.push(string); + }); + + help.push("
"); + help.push("Press [Tab] for auto completion."); + help.push("Press [Esc] to clear the input line."); + help.push( + "Press [↑][↓] to scroll through your history of commands." + ); + help.push("
"); + return help; +}; + +export const HELP = createHelp();