Make the from/to parameters optional. If one is missing, default to using the local timezone set in the computer.
Make the time parameter optional. If it's missing default to using the current time.
Implementations
We can make from/to parameters optional by using default parameter which is clap's feature.
We've already set this setting when adding ambiguous-time-strategy parameter to command.
.arg(Arg::new("ambiguous_time_strategy")
.short('a')
.long("ambiguous-time-strategy")
.value_name("STRATEGY")
.help("Strategy to use for ambiguous times (earliest, latest)")
.default_value("earliest")
.required(false)
About
Implementations
We can make from/to parameters optional by using default parameter which is clap's feature.
We've already set this setting when adding
ambiguous-time-strategy
parameter to command.Reference