These are chat archives for kbknapp/clap-rs

Apr 2018
Apr 20 2018 11:46
Can I have an argument which possible values depend on the value of other argument?
Like if I enter "build" then I have to enter either "one" or "two", but if I enter "run" then I have to enter either "one" or "three".
Apr 20 2018 12:04
any way of dealing required ref as fn argument when i can't gwaranteed its corectness, like here:
i've got Arg::with_name(name) but name is calcuated as String which doesn't live long enough
i mean name.as_ref() doesn't live long engouh
Kevin K.
Apr 20 2018 13:14
@KalitaAlexey not currently. There are some ways to make it happen, but it's not built in
if you can share a gist of what you'd like to happen, there may also be alternative ways to design the CLI to a similar outcome
Kevin K.
Apr 20 2018 13:21
@xliiv the problem is because you want to return the Arg from a function
where the name outlives the Arg
however, what most people do is have a fn return an App and not an Arg as having individual fn's for Args could be tedious
Apr 20 2018 13:23
@kbknapp thanks, i'll give it a try