git.delta.rocks / jrsonnet / refs/commits / fe52b32db444

difftreelog

build upgrade dependencies

Yaroslav Bolyukin2022-10-26parent: #30d381b.patch.diff
in: master

13 files changed

modifiedcmds/jrsonnet/Cargo.tomldiffbeforeafterboth
--- a/cmds/jrsonnet/Cargo.toml
+++ b/cmds/jrsonnet/Cargo.toml
@@ -28,5 +28,5 @@
 
 mimallocator = { version = "0.1.3", optional = true }
 thiserror = "1.0"
-clap = { version = "3.2", features = ["derive"] }
-clap_complete = { version = "3.2" }
+clap = { version = "4.0", features = ["derive"] }
+clap_complete = { version = "4.0" }
modifiedcmds/jrsonnet/src/main.rsdiffbeforeafterboth
--- a/cmds/jrsonnet/src/main.rs
+++ b/cmds/jrsonnet/src/main.rs
@@ -3,7 +3,7 @@
 	io::{Read, Write},
 };
 
-use clap::{AppSettings, IntoApp, Parser};
+use clap::{CommandFactory, Parser};
 use clap_complete::Shell;
 use jrsonnet_cli::{ConfigureState, GeneralOpts, ManifestOpts, OutputOpts};
 use jrsonnet_evaluator::{error::LocError, State};
@@ -42,10 +42,7 @@
 }
 
 #[derive(Parser)]
-#[clap(
-	global_setting = AppSettings::DeriveDisplayOrder,
-	args_conflicts_with_subcommands = true,
-)]
+#[clap(args_conflicts_with_subcommands = true, disable_version_flag = true)]
 struct Opts {
 	#[clap(subcommand)]
 	sub: Option<SubOpts>,
modifiedcrates/jrsonnet-cli/Cargo.tomldiffbeforeafterboth
--- a/crates/jrsonnet-cli/Cargo.toml
+++ b/crates/jrsonnet-cli/Cargo.toml
@@ -21,4 +21,4 @@
 jrsonnet-gcmodule = { version = "0.3.4" }
 jrsonnet-stdlib = { path = "../../crates/jrsonnet-stdlib", version = "0.4.2" }
 
-clap = { version = "3.2", features = ["derive"] }
+clap = { version = "4.0", features = ["derive"] }
modifiedcrates/jrsonnet-cli/src/lib.rsdiffbeforeafterboth
--- a/crates/jrsonnet-cli/src/lib.rs
+++ b/crates/jrsonnet-cli/src/lib.rs
@@ -44,7 +44,7 @@
 	/// Any not found `imported` file will be searched in these.
 	/// This can also be specified via `JSONNET_PATH` variable,
 	/// which should contain a colon-separated (semicolon-separated on Windows) list of directories.
-	#[clap(long, short = 'J', multiple_occurrences = true)]
+	#[clap(long, short = 'J')]
 	jpath: Vec<PathBuf>,
 }
 impl ConfigureState for MiscOpts {
modifiedcrates/jrsonnet-cli/src/manifest.rsdiffbeforeafterboth
--- a/crates/jrsonnet-cli/src/manifest.rs
+++ b/crates/jrsonnet-cli/src/manifest.rs
@@ -1,10 +1,11 @@
 use std::{path::PathBuf, str::FromStr};
 
-use clap::Parser;
+use clap::{Parser, ValueEnum};
 use jrsonnet_evaluator::{error::Result, ManifestFormat, State};
 
 use crate::ConfigureState;
 
+#[derive(Clone, ValueEnum)]
 pub enum ManifestFormatName {
 	/// Expect string as output, and write them directly
 	String,
@@ -28,7 +29,7 @@
 #[clap(next_help_heading = "MANIFESTIFICATION OUTPUT")]
 pub struct ManifestOpts {
 	/// Output format, wraps resulting value to corresponding std.manifest call.
-	#[clap(long, short = 'f', default_value = "json", possible_values = &["json", "yaml"])]
+	#[clap(long, short = 'f', default_value = "json")]
 	format: ManifestFormatName,
 	/// Expect plain string as output.
 	/// Mutually exclusive with `--format`
modifiedcrates/jrsonnet-cli/src/stdlib.rsdiffbeforeafterboth
--- a/crates/jrsonnet-cli/src/stdlib.rs
+++ b/crates/jrsonnet-cli/src/stdlib.rs
@@ -69,40 +69,19 @@
 	/// to use top level arguments whenever it's possible.
 	/// If [=data] is not set then it will be read from `name` env variable.
 	/// Can be accessed from code via `std.extVar("name")`.
-	#[clap(
-		long,
-		short = 'V',
-		name = "name[=var data]",
-		number_of_values = 1,
-		multiple_occurrences = true
-	)]
+	#[clap(long, short = 'V', name = "name[=var data]", number_of_values = 1)]
 	ext_str: Vec<ExtStr>,
 	/// Read string external variable from file.
 	/// See also `--ext-str`
-	#[clap(
-		long,
-		name = "name=var path",
-		number_of_values = 1,
-		multiple_occurrences = true
-	)]
+	#[clap(long, name = "name=var path", number_of_values = 1)]
 	ext_str_file: Vec<ExtFile>,
 	/// Add external variable from code.
 	/// See also `--ext-str`
-	#[clap(
-		long,
-		name = "name[=var source]",
-		number_of_values = 1,
-		multiple_occurrences = true
-	)]
+	#[clap(long, name = "name[=var source]", number_of_values = 1)]
 	ext_code: Vec<ExtStr>,
 	/// Read string external variable from file.
 	/// See also `--ext-str`
-	#[clap(
-		long,
-		name = "name=var code path",
-		number_of_values = 1,
-		multiple_occurrences = true
-	)]
+	#[clap(long, name = "name=var code path", number_of_values = 1)]
 	ext_code_file: Vec<ExtFile>,
 }
 impl ConfigureState for StdOpts {
modifiedcrates/jrsonnet-cli/src/tla.rsdiffbeforeafterboth
--- a/crates/jrsonnet-cli/src/tla.rs
+++ b/crates/jrsonnet-cli/src/tla.rs
@@ -10,40 +10,19 @@
 	/// Top level arguments will be passed to function before manifestification stage.
 	/// This is preferred to ExtVars method.
 	/// If [=data] is not set then it will be read from `name` env variable.
-	#[clap(
-		long,
-		short = 'A',
-		name = "name[=tla data]",
-		number_of_values = 1,
-		multiple_occurrences = true
-	)]
+	#[clap(long, short = 'A', name = "name[=tla data]", number_of_values = 1)]
 	tla_str: Vec<ExtStr>,
 	/// Read top level argument string from file.
 	/// See also `--tla-str`
-	#[clap(
-		long,
-		name = "name=tla path",
-		number_of_values = 1,
-		multiple_occurrences = true
-	)]
+	#[clap(long, name = "name=tla path", number_of_values = 1)]
 	tla_str_file: Vec<ExtFile>,
 	/// Add top level argument from code.
 	/// See also `--tla-str`
-	#[clap(
-		long,
-		name = "name[=tla source]",
-		number_of_values = 1,
-		multiple_occurrences = true
-	)]
+	#[clap(long, name = "name[=tla source]", number_of_values = 1)]
 	tla_code: Vec<ExtStr>,
 	/// Read top level argument code from file.
 	/// See also `--tla-str`
-	#[clap(
-		long,
-		name = "name=tla code path",
-		number_of_values = 1,
-		multiple_occurrences = true
-	)]
+	#[clap(long, name = "name=tla code path", number_of_values = 1)]
 	tla_code_file: Vec<ExtFile>,
 }
 impl ConfigureState for TLAOpts {
modifiedcrates/jrsonnet-cli/src/trace.rsdiffbeforeafterboth
before · crates/jrsonnet-cli/src/trace.rs
1use std::str::FromStr;23use clap::Parser;4use jrsonnet_evaluator::{5	error::Result,6	trace::{CompactFormat, ExplainingFormat, PathResolver},7	State,8};910use crate::ConfigureState;1112#[derive(PartialEq, Eq)]13pub enum TraceFormatName {14	Compact,15	Explaining,16}1718impl FromStr for TraceFormatName {19	type Err = &'static str;20	fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {21		Ok(match s {22			"compact" => TraceFormatName::Compact,23			"explaining" => TraceFormatName::Explaining,24			_ => return Err("no such format"),25		})26	}27}2829#[derive(Parser)]30#[clap(next_help_heading = "STACK TRACE VISUAL")]31pub struct TraceOpts {32	/// Format of stack traces' display in console.33	/// `compact` format only shows `filename:line:column`s34	/// while `explaining` displays source code with attached trace annotations35	/// thus being more verbose.36	#[clap(long, possible_values = &["compact", "explaining"])]37	trace_format: Option<TraceFormatName>,38	/// Amount of stack trace elements to be displayed.39	/// If set to `0` then full stack trace will be displayed.40	#[clap(long, short = 't', default_value = "20")]41	max_trace: usize,42}43impl ConfigureState for TraceOpts {44	type Guards = ();45	fn configure(&self, s: &State) -> Result<()> {46		let resolver = PathResolver::new_cwd_fallback();47		match self48			.trace_format49			.as_ref()50			.unwrap_or(&TraceFormatName::Compact)51		{52			TraceFormatName::Compact => s.set_trace_format(CompactFormat {53				resolver,54				padding: 4,55			}),56			TraceFormatName::Explaining => s.set_trace_format(ExplainingFormat { resolver }),57		}58		s.set_max_trace(self.max_trace);59		Ok(())60	}61}
after · crates/jrsonnet-cli/src/trace.rs
1use clap::{Parser, ValueEnum};2use jrsonnet_evaluator::{3	error::Result,4	trace::{CompactFormat, ExplainingFormat, PathResolver},5	State,6};78use crate::ConfigureState;910#[derive(PartialEq, Eq, ValueEnum, Clone)]11pub enum TraceFormatName {12	/// Only show `filename:line:column`13	Compact,14	/// Display source code with attached trace annotations15	Explaining,16}1718#[derive(Parser)]19#[clap(next_help_heading = "STACK TRACE VISUAL")]20pub struct TraceOpts {21	/// Format of stack traces' display in console.22	#[clap(long)]23	trace_format: Option<TraceFormatName>,24	/// Amount of stack trace elements to be displayed.25	/// If set to `0` then full stack trace will be displayed.26	#[clap(long, short = 't', default_value = "20")]27	max_trace: usize,28}29impl ConfigureState for TraceOpts {30	type Guards = ();31	fn configure(&self, s: &State) -> Result<()> {32		let resolver = PathResolver::new_cwd_fallback();33		match self34			.trace_format35			.as_ref()36			.unwrap_or(&TraceFormatName::Compact)37		{38			TraceFormatName::Compact => s.set_trace_format(CompactFormat {39				resolver,40				padding: 4,41			}),42			TraceFormatName::Explaining => s.set_trace_format(ExplainingFormat { resolver }),43		}44		s.set_max_trace(self.max_trace);45		Ok(())46	}47}
modifiedcrates/jrsonnet-evaluator/Cargo.tomldiffbeforeafterboth
--- a/crates/jrsonnet-evaluator/Cargo.toml
+++ b/crates/jrsonnet-evaluator/Cargo.toml
@@ -31,7 +31,7 @@
 jrsonnet-gcmodule = { version = "0.3.4" }
 
 pathdiff = "0.2.1"
-hashbrown = "0.12.1"
+hashbrown = "0.12.3"
 static_assertions = "1.1"
 
 rustc-hash = "1.1"
modifiedcrates/jrsonnet-interner/Cargo.tomldiffbeforeafterboth
--- a/crates/jrsonnet-interner/Cargo.toml
+++ b/crates/jrsonnet-interner/Cargo.toml
@@ -22,4 +22,4 @@
 structdump = { version = "0.2.0", optional = true }
 
 rustc-hash = "1.1"
-hashbrown = { version = "0.12.1", features = ["inline-more"] }
+hashbrown = { version = "0.12.3", features = ["inline-more"] }
modifiedcrates/jrsonnet-parser/src/expr.rsdiffbeforeafterboth
--- a/crates/jrsonnet-parser/src/expr.rs
+++ b/crates/jrsonnet-parser/src/expr.rs
@@ -190,6 +190,7 @@
 	}
 }
 
+#[cfg_attr(feature = "structdump", derive(Codegen))]
 #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
 #[derive(Debug, Clone, PartialEq, Eq, Trace)]
 pub enum DestructRest {
modifiedcrates/jrsonnet-stdlib/Cargo.tomldiffbeforeafterboth
--- a/crates/jrsonnet-stdlib/Cargo.toml
+++ b/crates/jrsonnet-stdlib/Cargo.toml
@@ -30,7 +30,7 @@
 # std.md5
 md5 = "0.7.0"
 # std.base64
-base64 = "0.13.0"
+base64 = "0.13.1"
 # std.parseJson
 serde_json = "1.0"
 # std.parseYaml, custom library fork is used for C++/golang compatibility
modifiedcrates/jrsonnet-types/Cargo.tomldiffbeforeafterboth
--- a/crates/jrsonnet-types/Cargo.toml
+++ b/crates/jrsonnet-types/Cargo.toml
@@ -9,4 +9,4 @@
 [dependencies]
 jrsonnet-gcmodule = { version = "0.3.4" }
 
-peg = "0.8.0"
+peg = "0.8.1"