From 7f53ef5df951ba361b720cfcd08132d1796b03ca Mon Sep 17 00:00:00 2001 From: Daylin Morgan Date: Thu, 7 Nov 2024 22:53:12 -0600 Subject: [PATCH] add todo --- src/hwylterm/hwylcli.nim | 15 +++++++++------ todo.md | 1 + 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/hwylterm/hwylcli.nim b/src/hwylterm/hwylcli.nim index 3498f33..5562ca8 100644 --- a/src/hwylterm/hwylcli.nim +++ b/src/hwylterm/hwylcli.nim @@ -697,7 +697,7 @@ func hwylCliImpl(cfg: CliCfg, root = false): NimNode = ) runBody.add handleSubCommands.add subCommandCase - + result.add quote do: # block: `printHelperProc` @@ -723,19 +723,21 @@ macro hwylCli*(body: untyped) = when isMainModule: import std/strformat + hwylCli: name "hwylterm" ... "a description of hwylterm" - globalFlags: - config: - T seq[string] - ? "path to config file" - * @["config.yml"] flags: check: T bool ? "load config and exit" - c + # --- other + config: + T seq[string] + ? "path to config file" + * @["config.yml"] + # ^ other run: echo "hello from the main command" echo fmt"{config=}, {check=}" @@ -743,6 +745,7 @@ when isMainModule: --- a ... "the \"a\" subcommand" flags: + # ^ other `long-flag` "some help" flagg "some other help" run: diff --git a/todo.md b/todo.md index 6cf1544..23e6aef 100644 --- a/todo.md +++ b/todo.md @@ -17,6 +17,7 @@ ### cli generato - [ ] add support for types(metavars)/defaults/required in help output +- [ ] add support for enum (parse string) - [ ] abstract the `globalFlags` argument to a `flagGroups` section with a builtin `global` this would allow users to "inherit" flag groups in subcommands ```nim