chore: linebreak for help command

This commit is contained in:
jinhojang6 2024-03-01 20:14:30 +09:00
parent 767701c9f7
commit a1df9af86c
No known key found for this signature in database
GPG Key ID: 1762F21FE8B543F8
1 changed files with 10 additions and 1 deletions

View File

@ -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(),