Add input validation for --creation-time/--lockup-date args (#7646)

automerge
This commit is contained in:
Michael Vines
2019-12-30 22:57:47 -07:00
committed by Grimes
parent 06c63f2026
commit 4b3bc587ab
6 changed files with 25 additions and 9 deletions

View File

@@ -33,7 +33,10 @@ where
}
}
pub fn unix_timestamp_of(matches: &ArgMatches<'_>, name: &str) -> Option<UnixTimestamp> {
pub fn unix_timestamp_from_rfc3339_datetime(
matches: &ArgMatches<'_>,
name: &str,
) -> Option<UnixTimestamp> {
matches.value_of(name).and_then(|value| {
DateTime::parse_from_rfc3339(value)
.ok()