mirror of
https://github.com/daylinmorgan/hwylterm.git
synced 2024-12-21 10:40:44 -06:00
add option to not autorun root
This commit is contained in:
parent
e8e090c5b7
commit
292bddd59f
2 changed files with 8 additions and 9 deletions
|
@ -126,9 +126,10 @@ type
|
|||
type
|
||||
# ----
|
||||
CliSetting* = enum
|
||||
NoHelpFlag, ## Remove the builtin help flag
|
||||
ShowHelp, ## If cmdline empty show help
|
||||
NoNormalize ## Don't normalize flags and commands
|
||||
GenerateOnly, ## Don't attach root `runProc()` node
|
||||
NoHelpFlag, ## Remove the builtin help flag
|
||||
ShowHelp, ## If cmdline empty show help
|
||||
NoNormalize ## Don't normalize flags and commands
|
||||
|
||||
BuiltinFlag = object
|
||||
name*: string
|
||||
|
@ -779,9 +780,11 @@ func hwylCliImpl(cfg: CliCfg): NimNode =
|
|||
let `args` {.used.} = `parserProcName`(`cmdLine`)
|
||||
`runBody`
|
||||
|
||||
# if cfg.root and (GenerateOnly notin cfg.settings):
|
||||
if cfg.root:
|
||||
result.add quote do:
|
||||
`runProcName`()
|
||||
if GenerateOnly notin cfg.settings:
|
||||
result.add quote do:
|
||||
`runProcName`()
|
||||
else:
|
||||
result.add quote do:
|
||||
`runProcName`(`args`[1..^1])
|
||||
|
|
|
@ -56,9 +56,6 @@ hwylCli:
|
|||
|
||||
a longer mulitline description that will be visible in the subcommand help
|
||||
and it will automatically be "bb"'ed [bold]this is bold text[/]
|
||||
|
||||
|
||||
|
||||
"""
|
||||
flags:
|
||||
a:
|
||||
|
@ -72,4 +69,3 @@ hwylCli:
|
|||
echo "hello from `example b` command"
|
||||
echo fmt"{a=}, {b=}"
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue