c-blake / cligen

Nim library to infer/generate command-line-interfaces / option / argument parsing; Docs at
https://c-blake.github.io/cligen/
ISC License
509 stars 24 forks source link

Wrong git tag #103

Closed SolitudeSF closed 5 years ago

SolitudeSF commented 5 years ago

Wrong git tag on the latest release. Actually prevents from installing it with nimble install cligen

c-blake commented 5 years ago

Yeah..I noticed that and was already working on it. Seems to be ok now, right?

SolitudeSF commented 5 years ago

yep

c-blake commented 5 years ago

Cool. Sorry for the misfire.

c-blake commented 5 years ago

You might (or might not) appreciate the new prefix matching of enum values in your pinggraph program which I notice uses several enums (and even specifies their strings). So, now you can say, for example, pinggraph -ts instead of -tshort or pinggraph -sbl instead of -s block.

SolitudeSF commented 5 years ago

i appreciate every opportunity to type less. thanks!

c-blake commented 5 years ago

If you engineer your enum strings with knowledge of this new cligen feature then you can probably get that keystroke down to 1 char pretty easily (much like chosing parameter names so that auto-inferred short option keys for long options do not collide). Probably obvious, I know.

In the longer run, I hope to get the same capability into long-option and subcommand matching, but that is much more work. Anyway, you're welcome and enjoy!

c-blake commented 5 years ago

Off topic, but of all the cligen uses in the Nimble package database, yours is the only one that I think will break with the new release. You're probably going to want to change:

dispatch pinggraph,
  version = ("version", "0.1.4"),
...

to

clCfg.version = "0.1.4"
dispatch
...

or even better

const nimbleFile = staticRead "../pinggraph.nimble"
clCfg.version = versionFromNimble(nimbleFile)
dispatch
...