git.delta.rocks / jrsonnet / refs/commits / 88be4ee7c720

difftreelog

feat help headings and colors

Yaroslav Bolyukin2020-10-19parent: #e99c281.patch.diff
in: master

9 files changed

modifiedCargo.lockdiffbeforeafterboth
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -62,8 +62,8 @@
 
 [[package]]
 name = "clap"
-version = "3.0.0-beta.1"
-source = "git+https://github.com/clap-rs/clap?rev=3e9ee86713b5c407b50ba76f30cffaed25952063#3e9ee86713b5c407b50ba76f30cffaed25952063"
+version = "3.0.0-beta.2"
+source = "git+https://github.com/clap-rs/clap?rev=1d0b21908f93478e75b4b1a21533d86325d39386#1d0b21908f93478e75b4b1a21533d86325d39386"
 dependencies = [
  "atty",
  "bitflags",
@@ -80,8 +80,8 @@
 
 [[package]]
 name = "clap_derive"
-version = "3.0.0-beta.1"
-source = "git+https://github.com/clap-rs/clap?rev=3e9ee86713b5c407b50ba76f30cffaed25952063#3e9ee86713b5c407b50ba76f30cffaed25952063"
+version = "3.0.0-beta.2"
+source = "git+https://github.com/clap-rs/clap?rev=1d0b21908f93478e75b4b1a21533d86325d39386#1d0b21908f93478e75b4b1a21533d86325d39386"
 dependencies = [
  "heck",
  "proc-macro-error",
modifiedcmds/jrsonnet/Cargo.tomldiffbeforeafterboth
--- a/cmds/jrsonnet/Cargo.toml
+++ b/cmds/jrsonnet/Cargo.toml
@@ -23,4 +23,4 @@
 
 [dependencies.clap]
 git = "https://github.com/clap-rs/clap"
-rev = "3e9ee86713b5c407b50ba76f30cffaed25952063"
+rev = "1d0b21908f93478e75b4b1a21533d86325d39386"
modifiedcmds/jrsonnet/src/main.rsdiffbeforeafterboth
--- a/cmds/jrsonnet/src/main.rs
+++ b/cmds/jrsonnet/src/main.rs
@@ -1,3 +1,4 @@
+use clap::AppSettings;
 use clap::Clap;
 use jrsonnet_cli::{ConfigureState, GeneralOpts, InputOpts, ManifestOpts, OutputOpts};
 use jrsonnet_evaluator::{error::LocError, EvaluationState};
@@ -13,7 +14,7 @@
 static GLOBAL: mimallocator::Mimalloc = mimallocator::Mimalloc;
 
 #[derive(Clap)]
-// #[clap(help_heading = "DEBUG")]
+#[clap(help_heading = "DEBUG")]
 struct DebugOpts {
 	/// Required OS stack size.
 	/// This shouldn't be changed unless jrsonnet is failing with stack overflow error.
@@ -22,6 +23,10 @@
 }
 
 #[derive(Clap)]
+#[clap(
+	global_setting = AppSettings::ColoredHelp,
+	global_setting = AppSettings::DeriveDisplayOrder,
+)]
 struct Opts {
 	#[clap(flatten)]
 	input: InputOpts,
modifiedcrates/jrsonnet-cli/Cargo.tomldiffbeforeafterboth
--- a/crates/jrsonnet-cli/Cargo.toml
+++ b/crates/jrsonnet-cli/Cargo.toml
@@ -13,4 +13,4 @@
 
 [dependencies.clap]
 git = "https://github.com/clap-rs/clap"
-rev = "3e9ee86713b5c407b50ba76f30cffaed25952063"
+rev = "1d0b21908f93478e75b4b1a21533d86325d39386"
modifiedcrates/jrsonnet-cli/src/ext.rsdiffbeforeafterboth
--- a/crates/jrsonnet-cli/src/ext.rs
+++ b/crates/jrsonnet-cli/src/ext.rs
@@ -54,7 +54,7 @@
 }
 
 #[derive(Clap)]
-// #[clap(help_heading = "EXTERNAL VARIABLES")]
+#[clap(help_heading = "EXTERNAL VARIABLES")]
 pub struct ExtVarOpts {
 	/// Add string external variable.
 	/// External variables are globally available so it is preferred
modifiedcrates/jrsonnet-cli/src/lib.rsdiffbeforeafterboth
--- a/crates/jrsonnet-cli/src/lib.rs
+++ b/crates/jrsonnet-cli/src/lib.rs
@@ -17,7 +17,7 @@
 }
 
 #[derive(Clap)]
-// #[clap(help_heading = "INPUT")]
+#[clap(help_heading = "INPUT")]
 pub struct InputOpts {
 	#[clap(
 		long,
@@ -33,7 +33,7 @@
 }
 
 #[derive(Clap)]
-// #[clap(help_heading = "OPTIONS")]
+#[clap(help_heading = "OPTIONS")]
 pub struct MiscOpts {
 	/// Disable standard library.
 	/// By default standard library will be available via global `std` variable.
modifiedcrates/jrsonnet-cli/src/manifest.rsdiffbeforeafterboth
23}23}
2424
25#[derive(Clap)]25#[derive(Clap)]
26// TODO: Restore arg group after issue fixed in clap26#[clap(group = clap::ArgGroup::new("output_format"), help_heading = "MANIFESTIFICATION OUTPUT")]
27// #[clap(group = clap::ArgGroup::new("output_format"), help_heading = "MANIFESTIFICATION OUTPUT")]
28pub struct ManifestOpts {27pub struct ManifestOpts {
29 /// Output format, wraps resulting value to corresponding std.manifest call.28 /// Output format, wraps resulting value to corresponding std.manifest call.
30 /// If set to `string` then plain string value is expected to be returned,29 /// If set to `string` then plain string value is expected to be returned,
33 format: ManifestFormatName,32 format: ManifestFormatName,
34 /// Expect plain string as output.33 /// Expect plain string as output.
35 /// Shortcut for `--format=string` thus this option is mutually exclusive with `format` option.34 /// Shortcut for `--format=string` thus this option is mutually exclusive with `format` option.
36 #[clap(long, short = 'S'/*, group = "output_format"*/)]35 #[clap(long, short = 'S', group = "output_format")]
37 string: bool,36 string: bool,
38 /// Write output as YAML stream, can be used with --format json/yaml37 /// Write output as YAML stream, can be used with --format json/yaml
39 #[clap(long, short = 'y')]38 #[clap(long, short = 'y')]
modifiedcrates/jrsonnet-cli/src/tla.rsdiffbeforeafterboth
--- a/crates/jrsonnet-cli/src/tla.rs
+++ b/crates/jrsonnet-cli/src/tla.rs
@@ -3,7 +3,7 @@
 use jrsonnet_evaluator::{error::Result, EvaluationState};
 
 #[derive(Clap)]
-// #[clap(help_heading = "TOP LEVEL ARGUMENTS")]
+#[clap(help_heading = "TOP LEVEL ARGUMENTS")]
 pub struct TLAOpts {
 	/// Add top level string argument.
 	/// Top level arguments will be passed to function before manifestification stage.
modifiedcrates/jrsonnet-cli/src/trace.rsdiffbeforeafterboth
--- a/crates/jrsonnet-cli/src/trace.rs
+++ b/crates/jrsonnet-cli/src/trace.rs
@@ -25,7 +25,7 @@
 }
 
 #[derive(Clap)]
-// #[clap(help_heading = "STACK TRACE VISUAL")]
+#[clap(help_heading = "STACK TRACE VISUAL")]
 pub struct TraceOpts {
 	/// Format of stack traces' display in console.
 	/// `compact` format only shows `filename:line:column`s