From 82dee625b5d665dc71e95a8c22ab8ad28bed08e2 Mon Sep 17 00:00:00 2001 From: lihbr Date: Thu, 27 May 2021 13:13:41 +0200 Subject: [PATCH] refactor: refactor help message --- src/commands/help.ts | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/commands/help.ts b/src/commands/help.ts index 19c007b..949d0ab 100644 --- a/src/commands/help.ts +++ b/src/commands/help.ts @@ -7,13 +7,16 @@ interface HelpSection { } export const help = (sections: HelpSection[]): void => { + sections[0].title = `Version`; + sections[0].body = ` ${PACKAGE}@${VERSION}`; + sections[sections.length - 1].body = `${ + sections[sections.length - 1].body + }\n`; + + // Add header sections.unshift({ body: `\nšŸ“š Dico CLI\n ${chalk.cyanBright( "Read the docs:" )} https://docs.dico.app/cli` }); - sections[1].body = `Version:\n ${PACKAGE}@${VERSION}`; - sections[sections.length - 1].body = `${ - sections[sections.length - 1].body - }\n`; };