difftreelog
feat add noop args from original jsonnet
in: master
1 file changed
cmds/jsonnet/src/main.rsdiffbeforeafterboth21#[derive(Clap)]21#[derive(Clap)]22#[clap(version = "0.1.0", author = "Lach <iam@lach.pw>")]22#[clap(version = "0.1.0", author = "Lach <iam@lach.pw>")]23struct Opts {23struct Opts {24 #[clap(about = "File to compile")]25 input: String,26 #[clap(long, about = "Disable global std variable")]24 #[clap(long, about = "Disable global std variable")]27 no_stdlib: bool,25 no_stdlib: bool,26 #[clap(long, about = "Add external string")]27 ext_str: Option<Vec<String>>,28 #[clap(long, about = "Add external string from code")]29 ext_code: Option<Vec<String>>,30 #[clap(long, about = "Add TLA")]31 tla_str: Option<Vec<String>>,32 #[clap(long, about = "Add TLA from code")]33 tla_code: Option<Vec<String>>,28 #[clap(long, short = "f", default_value = "none", possible_values = &["none", "json"])]34 #[clap(long, short = "f", default_value = "json", possible_values = &["none", "json"])]29 format: Format,35 format: Format,36 #[clap(about = "File to compile")]37 input: String,30}38}313932fn main() {40fn main() {50 }58 }51 evaluator.add_global("__tmp__to_json__".to_owned(), v);59 evaluator.add_global("__tmp__to_json__".to_owned(), v);52 v = evaluator60 v = evaluator53 .parse_evaluate_raw("std.manifestJson(__tmp__to_json__)")61 .parse_evaluate_raw("std.manifestJsonEx(__tmp__to_json__, \" \")")54 .expect("json serialization");62 .expect("json serialization");55 }63 }56 match v {64 match v {