#4 unlabledvalueargs seem to be always required.

closed
nobody
None
5
2005-01-27
2005-01-22
hbutler
No

I'm trying to construct a command line that has an
optional switch and an optional unlabled arg.

for example

debug -l
debug command_name

When I enter debug -l, an exeception gets throw saying
that I don't have one of the required args.
around line 235 unlabeledvaluearg.h you have.
: ValueArg<T>("", name, desc, true, val, typeDesc, v)

I think hardwireing req to true is the problem. I changed
my code to this and this particular problem went away.
I didn't dig enough to figure out if this broke other stuff,
but basically I should be able to state where or not this
is required.

: ValueArg<T>("", name, desc, ignoreable, val,
typeDesc, v)

Discussion

  • Mike Smoot
    Mike Smoot
    2005-01-22

    Logged In: YES
    user_id=27603

    Yeah, I can't seem to remember why I made them required.
    I'm going to make the change and bang on things a bit to
    make sure it doesn't break something. I should have a
    resolution in relatively short order.

     
  • Mike Smoot
    Mike Smoot
    2005-01-24

    Logged In: YES
    user_id=27603

    This is fixed in CVS. Assuming I don't uncover any
    significant problems, it'll be in the next release.

     
  • Mike Smoot
    Mike Smoot
    2005-01-27

    • status: open --> closed
     
  • Mike Smoot
    Mike Smoot
    2006-08-19

    Logged In: YES
    user_id=27603

    This is in release 1.1.0