aboutsummaryrefslogtreecommitdiffstats
path: root/src/bin
diff options
context:
space:
mode:
Diffstat (limited to 'src/bin')
-rw-r--r--src/bin/mt-tool.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/bin/mt-tool.rs b/src/bin/mt-tool.rs
index 929990f..8ef2464 100644
--- a/src/bin/mt-tool.rs
+++ b/src/bin/mt-tool.rs
@@ -57,6 +57,8 @@ fn main() {
let mut opts = Options::new();
opts.optflag("h", "help", "print this help menu");
opts.optflag("", "version", "print the version");
+ opts.optmulti("", "dep", "dependent variable", "VAR");
+ opts.optmulti("", "indep", "dependent variable", "VAR");
let matches = match opts.parse(&args[1..]) {
Ok(m) => m,
@@ -85,6 +87,14 @@ fn main() {
let cmd = matches.free[0].clone();
match cmd.as_str() {
"parse" => { parse_modelica_files(matches.free[1..].iter().map(|x| x.to_string()).collect()); },
+ "solve_for" => {
+ if matches.free.len() != 2 {
+ println!("Expected a path to load");
+ exit(-1);
+ }
+ let me = modelthing::load_model_entry(Path::new(&matches.free[1])).unwrap();
+ println!("{:?}", me.ast.solve_for(matches.opt_strs("indep"), matches.opt_strs("dep")));
+ },
"transpile_scheme" => {
if matches.free.len() != 2 {
println!("Expected a single path to load");