From 16cc0b910de8f39394d042562ab45b7e0707482e Mon Sep 17 00:00:00 2001 From: Daylin Morgan Date: Fri, 8 Nov 2024 14:21:46 -0600 Subject: [PATCH] version flag is captial V --- src/hwylterm/hwylcli.nim | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/hwylterm/hwylcli.nim b/src/hwylterm/hwylcli.nim index 1270358..3498f33 100644 --- a/src/hwylterm/hwylcli.nim +++ b/src/hwylterm/hwylcli.nim @@ -392,6 +392,10 @@ func parseCliBody(body: NimNode, name = ""): CliCfg = if result.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 = result = newTree(nnkBracket) @@ -406,13 +410,14 @@ func flagsArray(cfg: CliCfg): NimNode = result.add quote do: (`short`, `long`, `help`) + if NoHelpFlag notin cfg.settings: result.add quote do: ("h", "help", "show this help") if cfg.version != nil: result.add quote do: - ("v", "version", "print version") + ("V", "version", "print version") func subCmdsArray(cfg: CliCfg): NimNode = result = newTree(nnkBracket)