I'm using clap crate to parse command line for my app. I have an option with f32 value, say radius which has a default value assigned in my struct Args {} (I'm using derive clap's API).
How can I check in my code whether the --radius flag was actually specified by a user? Even if It was not explicitly used, I'd like to read the default value assigned to it.
Secondly, it's still unclear to me how to check whether the flag was used. Ideally, I'd like to do sth like:
let val = args.radius;
let was_used = args.was_used("radius");
if was_used {
println!("{} was given", val);
} else {
println!("using {} as the default", val);
}