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

cmdName not applied for error messages #90

Closed Nindaleth closed 5 years ago

Nindaleth commented 5 years ago

EDIT: version: 0.9.19

I have renamed my openLog into tttlatest like this:

import cligen
dispatch(openLog, cmdName = "tttlatest")

While it works properly for getting help

Usage:
  tttlatest [optional-params]
  (...)

calling it with improper input ./exename 3 incorrectly returns

openLog does not expect non-option arguments. Got (...)
c-blake commented 5 years ago

I think the change I just pushed to my devel should fix your problem. It did for me. Let me know if it does not. If it does, I can punch a new release of cligen soon.

Nindaleth commented 5 years ago

Yup, it works. Thanks for the quick fix!

c-blake commented 5 years ago

You're welcome. That was a really easy one...just grep for the expect.non.option and see the wrong variable being used. A 1-token fix. :-)