From 215d807a3df1706b9331b89bbb69de23e0d080fb Mon Sep 17 00:00:00 2001 From: Sangelo Date: Thu, 5 Oct 2023 20:11:08 +0200 Subject: [PATCH] Work on help --- src/subcommands/help.nim | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/src/subcommands/help.nim b/src/subcommands/help.nim index e859dff..2b2f9c6 100644 --- a/src/subcommands/help.nim +++ b/src/subcommands/help.nim @@ -1,10 +1,12 @@ -# src/subcommands/help.nim +# src/commands/help.nim +import terminal + type Command = tuple[ cmd: string, desc: string ] - Argument = tuple[ + Option = tuple[ arg: string, desc: string ] @@ -12,22 +14,28 @@ type var commands: seq[Command] = @[ ("help", "Displays this help message"), ("init", "Initialise a project directory with default settings"), + ("template", "Initialise a project directory with default settings"), ] -var arguments: seq[Argument] = @[ +var options: seq[Option] = @[ ("-h", "Displays this help message") ] proc displayHelp*() = echo "dashinit - a powerful templating tool" - + echo "\nUsage:" - echo "\tdashinit [subcommand] [arguments]" - + styledEcho styleBright, " dashinit", resetStyle, " [subcommand] [arguments]" + echo "\nSubcommands:" for command in commands: - echo "\t", command.cmd, "\t", command.desc + styledEcho " ", styleBright, command.cmd, resetStyle, " \t", command.desc - echo "\nArguments:" - for argument in arguments: - echo "\t", argument.arg, "\t", argument.desc \ No newline at end of file + echo "\nOptions:" + for option in options: + styledEcho " ", styleBright, option.arg, resetStyle, " \t", option.desc + + echo "\nExamples:" + echo " dashinit\t\t\tInitialises using default settings." + styledEcho " ", "dashinit ", "template get ", fgBlue, "", resetStyle, "\tGets a template from the internet" + # styledEcho styleBright, fgGreen, "[PASS]", resetStyle, fgGreen, " Yay!" \ No newline at end of file