git.delta.rocks / jrsonnet / refs/commits / 31f2b649c192

difftreelog

Enable multi-occurences for --jpath + improve positional params error message

Loris FRIEDEL2021-11-03parent: #afbb8dc.patch.diff
in: master

2 files changed

modifiedcrates/jrsonnet-cli/src/lib.rsdiffbeforeafterboth
51 /// 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 {
modifiedcrates/jrsonnet-parser/src/lib.rsdiffbeforeafterboth
--- a/crates/jrsonnet-parser/src/lib.rs
+++ b/crates/jrsonnet-parser/src/lib.rs
@@ -62,7 +62,7 @@
 				let mut defaults_started = false;
 				for param in &params {
 					defaults_started = defaults_started || param.1.is_some();
-					assert_eq!(defaults_started, param.1.is_some(), "defauld parameters should be used after all positionals");
+					assert_eq!(defaults_started, param.1.is_some(), "defauld parameters should be used after all positionals. Misplaced default parameter: {:?}", param.0);
 				}
 				expr::ParamsDesc(Rc::new(params))
 			}