These are chat archives for kbknapp/clap-rs

20th
Jan 2018
Kevin K.
@kbknapp
Jan 20 2018 03:42
@willmurphyscode sorry I was out today, I'll check it tomorrow and we should be able to merge it :)
Emil Gardström
@Emilgardis
Jan 20 2018 16:33
Hello! I can't find a way to provide a default value for an arg if another arg is not provided. I've looked around and there seems to be no way. I was thinking of making Valued::default_value_ifs into Option<VecMap<(_,_,Option<_>)> and go from there. I'm asking here first before I try to implement it as it does seem like some work to implement.
My use-case is that I have an App that has a flag count, this count should be defaulted to "5" if the flag all is not specified. Right now, I can only set count to "" via _::default_value_if("all", None, ""), but what I want is _::default_value_if("all",None,None)
Emil Gardström
@Emilgardis
Jan 20 2018 16:40
This change "should" be backwards compatible, as there is a impl From<T> for Option<T>
Emil Gardström
@Emilgardis
Jan 20 2018 16:48
ping @kbknapp
Kevin K.
@kbknapp
Jan 20 2018 17:15
@endeav0r just so I understand correctly, if --all is used, --count should default to S otherwise it should have no default?