shunsock / timezone_translator

simple command-line utility that converts a given time from one timezone to another.
MIT License
23 stars 1 forks source link

Short hand command syntax for from/to #27

Closed shunsock closed 3 months ago

shunsock commented 3 months ago

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.

        .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)

Reference

shunsock commented 3 months ago

created branch: feature/default_timezone https://github.com/shunsock/timezone_translator/tree/feature/default_timezone