-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Address back-handed requested missing feature to have "secret" option…
…s via nim-lang/Nim#12425 Usage is the CL author saying `help={"param": "SUPPRESS"}` with the special string being re-definable via, e.g., `clCfg.hTabSuppress = "**HIDDEN**"`. Ammend test prog to try it out & update reference output for line numbers.
- Loading branch information
Showing
3 changed files
with
12 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,16 @@ | ||
proc demo(al_pha=1, be_ta=2.0, verb=false, item="", args: seq[string]) = | ||
proc demo(al_pha=1, be_ta=2.0, verb=false, jk=9, item="", args: seq[string]) = | ||
## demo entry point with varied, meaningless parameters. A Nim invocation | ||
## might be: demo(alpha=2, @[ "hi", "ho" ]) corresponding to the command | ||
## invocation "demo --alpha=2 hi ho" (assuming executable gets named demo). | ||
echo "alpha:", alpha, " beta:", beta, " verb:", verb, " item:", repr(item) | ||
echo "jk: ", jk | ||
for i, arg in args: echo "positional[", i, "]: ", repr(arg) | ||
|
||
when isMainModule: | ||
import cligen | ||
dispatch(demo, | ||
help = { "al-pha" : "growth constant", | ||
"be-ta" : "shrink target" }, | ||
"be-ta" : "shrink target", | ||
"jk" : "SUPPRESS" }, | ||
short = { "a-lpha" : 'z', | ||
"b-eta" : '\0' }) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters