difftreelog
Enable multi-occurences for --jpath + improve positional params error message
in: master
2 files changed
crates/jrsonnet-cli/src/lib.rsdiffbeforeafterboth51 /// Any not found `imported` file will be searched in these.51 /// Any not found `imported` file will be searched in these.52 /// This can also be specified via `JSONNET_PATH` variable,52 /// This can also be specified via `JSONNET_PATH` variable,53 /// which should contain a colon-separated (semicolon-separated on Windows) list of directories.53 /// which should contain a colon-separated (semicolon-separated on Windows) list of directories.54 #[clap(long, short = 'J')]54 #[clap(long, short = 'J', multiple_occurrences = true)]55 jpath: Vec<PathBuf>,55 jpath: Vec<PathBuf>,56}56}57impl ConfigureState for MiscOpts {57impl ConfigureState for MiscOpts {crates/jrsonnet-parser/src/lib.rsdiffbeforeafterboth62 let mut defaults_started = false;62 let mut defaults_started = false;63 for param in ¶ms {63 for param in ¶ms {64 defaults_started = defaults_started || param.1.is_some();64 defaults_started = defaults_started || param.1.is_some();65 assert_eq!(defaults_started, param.1.is_some(), "defauld parameters should be used after all positionals");65 assert_eq!(defaults_started, param.1.is_some(), "defauld parameters should be used after all positionals. Misplaced default parameter: {:?}", param.0);66 }66 }67 expr::ParamsDesc(Rc::new(params))67 expr::ParamsDesc(Rc::new(params))68 }68 }