add date validation message

This commit is contained in:
dvvvvvv 2019-11-10 15:53:26 +09:00 committed by Abin Simon
parent 50cf660567
commit e6ee773277

View file

@ -138,7 +138,7 @@ pub fn build() -> App<'static, 'static> {
.default_value("date")
.multiple(true)
.number_of_values(1)
.help("How to display date"),
.help("How to display date [possible values: date, relative, +date-time-format]"),
)
.arg(
Arg::with_name("timesort")
@ -213,7 +213,10 @@ fn validate_date_argument(arg: String) -> Result<(), String> {
} else if &arg == "relative" {
Result::Ok(())
} else {
Result::Err("possible values: date, relative".to_owned())
Result::Err(
"possible values: date, relative, +date-time-format"
.to_owned()
)
}
}