These are chat archives for kbknapp/clap-rs

13th
Oct 2016
Hendrik Sollich
@hoodie
Oct 13 2016 00:42
hey there
is it somehow possible to specify an option to take no value and hence behave like a flag?
So there can be a case where --archive and --archive 2015 would both be valid, with the first falling back to a default value
Kevin K.
@kbknapp
Oct 13 2016 00:46
You can try Arg::number_of_values(0)
I can't remember if I've guarded against 0 or not though
Hendrik Sollich
@hoodie
Oct 13 2016 00:47
wouldn't that prohibit the latter case?
both wouldn't work
Kevin K.
@kbknapp
Oct 13 2016 00:48
Sorry I mean minimum_values
:P
Hendrik Sollich
@hoodie
Oct 13 2016 00:49
I tried that first, but then it registeres as not present
I supposed this corner case could be considered a bug
I could take a look at that and perhaps offer a PR tomorrow
Kevin K.
@kbknapp
Oct 13 2016 00:51
Yeah for sure! Thanks!
Hendrik Sollich
@hoodie
Oct 13 2016 08:16
Ok nevermind, it already works as is should, I missed a something in my code
Kevin K.
@kbknapp
Oct 13 2016 12:01
:+1: