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
|
type
|
||||||
Command = tuple[
|
Command = tuple[
|
||||||
cmd: string,
|
cmd: string,
|
||||||
desc: string
|
desc: string
|
||||||
]
|
]
|
||||||
Argument = tuple[
|
Option = tuple[
|
||||||
arg: string,
|
arg: string,
|
||||||
desc: string
|
desc: string
|
||||||
]
|
]
|
||||||
|
@ -12,9 +14,10 @@ type
|
||||||
var commands: seq[Command] = @[
|
var commands: seq[Command] = @[
|
||||||
("help", "Displays this help message"),
|
("help", "Displays this help message"),
|
||||||
("init", "Initialise a project directory with default settings"),
|
("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")
|
("-h", "Displays this help message")
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -22,12 +25,17 @@ proc displayHelp*() =
|
||||||
echo "dashinit - a powerful templating tool"
|
echo "dashinit - a powerful templating tool"
|
||||||
|
|
||||||
echo "\nUsage:"
|
echo "\nUsage:"
|
||||||
echo "\tdashinit [subcommand] [arguments]"
|
styledEcho styleBright, " dashinit", resetStyle, " [subcommand] [arguments]"
|
||||||
|
|
||||||
echo "\nSubcommands:"
|
echo "\nSubcommands:"
|
||||||
for command in commands:
|
for command in commands:
|
||||||
echo "\t", command.cmd, "\t", command.desc
|
styledEcho " ", styleBright, command.cmd, resetStyle, " \t", command.desc
|
||||||
|
|
||||||
echo "\nArguments:"
|
echo "\nOptions:"
|
||||||
for argument in arguments:
|
for option in options:
|
||||||
echo "\t", argument.arg, "\t", argument.desc
|
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