Set the policy's reference time to the configured reference time
- If the user specifies `--time`, then use it, not the current time, as the reference time for the policy object.
This commit is contained in:
parent
16fd67a10c
commit
7b4ed970af
16
src/sq.rs
16
src/sq.rs
@ -666,16 +666,8 @@ fn main() -> Result<()> {
|
||||
return Ok(())
|
||||
}
|
||||
|
||||
let policy = &mut P::new();
|
||||
|
||||
let c = sq_cli::SqCommand::from_arg_matches(&sq_cli::build().get_matches())?;
|
||||
|
||||
let known_notations = c.known_notation
|
||||
.iter()
|
||||
.map(|n| n.as_str())
|
||||
.collect::<Vec<&str>>();
|
||||
policy.good_critical_notations(&known_notations);
|
||||
|
||||
let time = if let Some(time) = c.time {
|
||||
SystemTime::from(
|
||||
crate::parse_iso8601(
|
||||
@ -685,6 +677,14 @@ fn main() -> Result<()> {
|
||||
SystemTime::now()
|
||||
};
|
||||
|
||||
let policy = &mut P::at(time);
|
||||
|
||||
let known_notations = c.known_notation
|
||||
.iter()
|
||||
.map(|n| n.as_str())
|
||||
.collect::<Vec<&str>>();
|
||||
policy.good_critical_notations(&known_notations);
|
||||
|
||||
let force = c.force;
|
||||
let output_format = OutputFormat::from_str(&c.output_format)?;
|
||||
let output_version = if let Some(v) = c.output_version {
|
||||
|
Loading…
Reference in New Issue
Block a user