From a1df9af86c34c38a205ef69a94bf1974997e1009 Mon Sep 17 00:00:00 2001 From: jinhojang6 Date: Fri, 1 Mar 2024 20:14:30 +0900 Subject: [PATCH] chore: linebreak for help command --- src/utils/commands.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/utils/commands.ts b/src/utils/commands.ts index 172a9b5..bdf0598 100644 --- a/src/utils/commands.ts +++ b/src/utils/commands.ts @@ -15,7 +15,16 @@ export const commands: Record< return htmlString; }, - help: () => "Available commands: " + Object.keys(commands).join(", "), + help: () => { + const commandsList = Object.keys(commands); + const lineBreak = commandsList.findIndex((c) => c === "echo"); + + const list = + commandsList.slice(0, lineBreak).join(", ") + + "\n" + + commandsList.slice(lineBreak).join(", "); + return "Available commands: " + list; + }, hostname: () => hostname, whoami: () => "guest", date: () => new Date().toLocaleString(),