Doesn't handle negative numbers for an arg
If you want to have a program that has a negative number for an arg, commander.c causes a segfault.
./myprog --n -5
or...
./myprog -n "-5"
Any thoughts on why?
Doesn't actually crash, that's a result of my strtod code trying to convert a null value. But it does print: unrecognized flag -5.
commander interprets it as a flag currently, we could special-case digits, might as well
Seems like any value that starts with - is misinterpreted as a flag.
For example, if I pass in "--- No way jose" I get the following message:
unrecognized flag --- No way jose"
I tried wrapping it in quotes but that didn't help. Any way around this?
not currently, but we should support -- for separating args
oh we do :D
./test foo -- --stuff --here
additional args:
- 'foo'
- '--stuff'
- '--here'