Work on help
This commit is contained in:
parent
ebf299f140
commit
215d807a3d
1 changed files with 18 additions and 10 deletions
|
@ -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
|
||||
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, "<url>", resetStyle, "\tGets a template from the internet"
|
||||
# styledEcho styleBright, fgGreen, "[PASS]", resetStyle, fgGreen, " Yay!"
|
Loading…
Reference in a new issue