1use crate::{ConfigureState, ExtStr};2use clap::Clap;3use jrsonnet_evaluator::{EvaluationState, Result};45#[derive(Clap)]67pub struct TLAOpts {8 9 10 11 12 #[clap(long, short = 'A', name = "name[=tla data]", number_of_values = 1)]13 tla_str: Vec<ExtStr>,14 15 16 17 18 19 20 #[clap(long, name = "name[=tla source]", number_of_values = 1)]21 tla_code: Vec<ExtStr>,22}23impl ConfigureState for TLAOpts {24 fn configure(&self, state: &EvaluationState) -> Result<()> {25 for tla in self.tla_str.iter() {26 state.add_tla_str((&tla.name as &str).into(), (&tla.value as &str).into());27 }28 for tla in self.tla_code.iter() {29 state.add_tla_code((&tla.name as &str).into(), (&tla.value as &str).into())?;30 }31 Ok(())32 }33}