c-blake / cligen

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

enum type shows 1st enum value instead of REQUIRED #55

Closed timotheecour closed 5 years ago

timotheecour commented 5 years ago
type Foo = enum
  bar1,
  bar2,

type Age = int

proc main(foo: Foo, age: Age)=
  echo (foo, age)

import cligen
dispatch(main)
Usage:
  main [required&optional-params]
  Options(opt-arg sep :|=|spc):
  -h, --help                   write this help to stdout
  -f=, --foo=  enum  bar1      set foo
  -a=, --age=  int   REQUIRED  set age

i would expect -f=, --foo= enum REQUIRED set foo in this case

c-blake commented 5 years ago

Good catch. Fixed.