mirror of
https://github.com/daylinmorgan/hwylterm.git
synced 2024-11-16 06:28:32 -06:00
version flag is captial V
This commit is contained in:
parent
e964581b13
commit
16cc0b910d
1 changed files with 6 additions and 1 deletions
|
@ -392,6 +392,10 @@ func parseCliBody(body: NimNode, name = ""): CliCfg =
|
||||||
if result.name == "":
|
if result.name == "":
|
||||||
error "missing required option: name"
|
error "missing required option: name"
|
||||||
|
|
||||||
|
# TODO: here an elsewhere make help/version less special
|
||||||
|
# and just append to "opts" at that point
|
||||||
|
# check for h,V in existing opts and use if available
|
||||||
|
|
||||||
func flagsArray(cfg: CliCfg): NimNode =
|
func flagsArray(cfg: CliCfg): NimNode =
|
||||||
result = newTree(nnkBracket)
|
result = newTree(nnkBracket)
|
||||||
|
|
||||||
|
@ -406,13 +410,14 @@ func flagsArray(cfg: CliCfg): NimNode =
|
||||||
result.add quote do:
|
result.add quote do:
|
||||||
(`short`, `long`, `help`)
|
(`short`, `long`, `help`)
|
||||||
|
|
||||||
|
|
||||||
if NoHelpFlag notin cfg.settings:
|
if NoHelpFlag notin cfg.settings:
|
||||||
result.add quote do:
|
result.add quote do:
|
||||||
("h", "help", "show this help")
|
("h", "help", "show this help")
|
||||||
|
|
||||||
if cfg.version != nil:
|
if cfg.version != nil:
|
||||||
result.add quote do:
|
result.add quote do:
|
||||||
("v", "version", "print version")
|
("V", "version", "print version")
|
||||||
|
|
||||||
func subCmdsArray(cfg: CliCfg): NimNode =
|
func subCmdsArray(cfg: CliCfg): NimNode =
|
||||||
result = newTree(nnkBracket)
|
result = newTree(nnkBracket)
|
||||||
|
|
Loading…
Reference in a new issue