fix cli variable override
This commit is contained in:
parent
f7d5b57b66
commit
41aeef83d4
1 changed files with 7 additions and 5 deletions
|
@ -97,8 +97,9 @@ fn parse_and_compile(opts: &PlayOpts) -> anyhow::Result<Vec<f64>> {
|
||||||
opts.slopes()
|
opts.slopes()
|
||||||
.map(|(s, (v, e))| (s, VariableChange(*v, e.clone())))
|
.map(|(s, (v, e))| (s, VariableChange(*v, e.clone())))
|
||||||
.collect::<Vec<_>>(),
|
.collect::<Vec<_>>(),
|
||||||
opts.variables()
|
HashMap::from(default_variables)
|
||||||
.chain(HashMap::from(default_variables).iter())
|
.iter()
|
||||||
|
.chain(opts.variables())
|
||||||
.map(|(v, _)| *v)
|
.map(|(v, _)| *v)
|
||||||
.collect::<Vec<_>>(),
|
.collect::<Vec<_>>(),
|
||||||
);
|
);
|
||||||
|
@ -118,9 +119,10 @@ fn parse_and_compile(opts: &PlayOpts) -> anyhow::Result<Vec<f64>> {
|
||||||
let compiler = Compiler::from(Context::new(
|
let compiler = Compiler::from(Context::new(
|
||||||
'L'.to_string(),
|
'L'.to_string(),
|
||||||
'n'.to_string(),
|
'n'.to_string(),
|
||||||
opts.variables()
|
default_variables
|
||||||
.map(|(a, b)| (a.to_string(), *b))
|
.map(|(c, v)| (c.to_string(), v))
|
||||||
.chain(default_variables.map(|(c, v)| (c.to_string(), v))),
|
.into_iter()
|
||||||
|
.chain(opts.variables().map(|(a, b)| (a.to_string(), *b))),
|
||||||
opts.instrument().clone(),
|
opts.instrument().clone(),
|
||||||
opts.slopes()
|
opts.slopes()
|
||||||
.map(|(_, (a, b))| (a.to_string(), b.clone()))
|
.map(|(_, (a, b))| (a.to_string(), b.clone()))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue