mirror of
https://github.com/lsd-rs/lsd
synced 2025-03-05 07:27:20 +00:00
add date validation message
This commit is contained in:
parent
50cf660567
commit
e6ee773277
1 changed files with 5 additions and 2 deletions
|
@ -138,7 +138,7 @@ pub fn build() -> App<'static, 'static> {
|
||||||
.default_value("date")
|
.default_value("date")
|
||||||
.multiple(true)
|
.multiple(true)
|
||||||
.number_of_values(1)
|
.number_of_values(1)
|
||||||
.help("How to display date"),
|
.help("How to display date [possible values: date, relative, +date-time-format]"),
|
||||||
)
|
)
|
||||||
.arg(
|
.arg(
|
||||||
Arg::with_name("timesort")
|
Arg::with_name("timesort")
|
||||||
|
@ -213,7 +213,10 @@ fn validate_date_argument(arg: String) -> Result<(), String> {
|
||||||
} else if &arg == "relative" {
|
} else if &arg == "relative" {
|
||||||
Result::Ok(())
|
Result::Ok(())
|
||||||
} else {
|
} else {
|
||||||
Result::Err("possible values: date, relative".to_owned())
|
Result::Err(
|
||||||
|
"possible values: date, relative, +date-time-format"
|
||||||
|
.to_owned()
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue