mirror of
https://github.com/daylinmorgan/hwylterm.git
synced 2025-02-23 09:45:50 -06:00
help should be a const
This commit is contained in:
parent
bf542a1470
commit
2bb4463f58
1 changed files with 3 additions and 5 deletions
|
@ -941,7 +941,7 @@ func flagToTuple(c: CliCfg, f: CliFlag): NimNode =
|
||||||
else:
|
else:
|
||||||
let val = f.defaultVal
|
let val = f.defaultVal
|
||||||
quote do:
|
quote do:
|
||||||
bbEscape($`val`)
|
bbEscape($(`val`))
|
||||||
|
|
||||||
required = newLit(c.isRequiredFlag(f))
|
required = newLit(c.isRequiredFlag(f))
|
||||||
typeNode =
|
typeNode =
|
||||||
|
@ -964,9 +964,7 @@ func flagToTuple(c: CliCfg, f: CliFlag): NimNode =
|
||||||
defaultVal,
|
defaultVal,
|
||||||
required,
|
required,
|
||||||
)
|
)
|
||||||
# quote do:
|
|
||||||
# (`short`, `long`, `help`, bbEscape($`defaultVal`), `required`)
|
|
||||||
#
|
|
||||||
func flagsArray(cfg: CliCfg): NimNode =
|
func flagsArray(cfg: CliCfg): NimNode =
|
||||||
result = newTree(nnkBracket)
|
result = newTree(nnkBracket)
|
||||||
for f in cfg.flags:
|
for f in cfg.flags:
|
||||||
|
@ -1020,7 +1018,7 @@ func generateCliHelpProc(cfg: CliCfg, printHelpName: NimNode): NimNode =
|
||||||
|
|
||||||
result = quote do:
|
result = quote do:
|
||||||
proc `printHelpName`() =
|
proc `printHelpName`() =
|
||||||
const help =
|
let help =
|
||||||
newHwylCliHelp(
|
newHwylCliHelp(
|
||||||
header = `header`,
|
header = `header`,
|
||||||
footer = `footer`,
|
footer = `footer`,
|
||||||
|
|
Loading…
Add table
Reference in a new issue