summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCanop <cano.petrole@gmail.com>2024-03-05 19:55:30 +0100
committerCanop <cano.petrole@gmail.com>2024-03-05 19:55:30 +0100
commita4e6d77c28f61a50f11601b585ce1b6ef83d316e (patch)
treebe3f7af9739cca9064be9e89d4496cb3d41329f7
parent2fc2283b2bdbfdbaba9b265ee719eb64c0b58a73 (diff)
improve --help
-rw-r--r--Cargo.lock4
-rw-r--r--Cargo.toml4
-rw-r--r--src/cli/args.rs8
-rw-r--r--src/cli/mod.rs1
4 files changed, 8 insertions, 9 deletions
diff --git a/Cargo.lock b/Cargo.lock
index f9ed044..49e9e03 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -350,9 +350,7 @@ dependencies = [
[[package]]
name = "clap-help"
-version = "1.1.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f9905b63b5378811dd974fad735dd177c02bf8390a8ccc7c3676aff8ecc1a881"
+version = "1.2.0"
dependencies = [
"clap",
"termimad",
diff --git a/Cargo.toml b/Cargo.toml
index bff4cff..75160dd 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -28,7 +28,7 @@ bet = "1.0.2"
char_reader = "0.1"
chrono = "0.4"
clap = { version = "4.4", features = ["derive", "cargo"] }
-clap-help = "1.1.2"
+clap-help = "1.2.0"
cli-log = "2.0"
crokey = "0.6.3"
crossbeam = "0.8"
@@ -107,7 +107,7 @@ harness = false
[patch.crates-io]
# bet = { path = "../bet" }
-# clap-help = { path = "../clap-help" }
+clap-help = { path = "../clap-help" }
# cli-log = { path = "../cli-log" }
# crossterm = { path = "../crossterm-rs/crossterm" }
# csv2svg = { path = "../csv2svg" }
diff --git a/src/cli/args.rs b/src/cli/args.rs
index 0dd7e86..3e9ccef 100644
--- a/src/cli/args.rs
+++ b/src/cli/args.rs
@@ -9,7 +9,7 @@ use {
/// Launch arguments
#[derive(Debug, Parser)]
-#[command(author, about, version, disable_version_flag = true, disable_help_flag = true)]
+#[command(about, version, disable_version_flag = true, disable_help_flag = true)]
pub struct Args {
/// Print help information
@@ -140,7 +140,7 @@ pub struct Args {
#[arg(long, value_name = "path")]
pub outcmd: Option<PathBuf>,
- /// An optional path where to write when a verb uses `:write_output`
+ /// Optional path for verbs using `:write_output`
#[arg(long, value_name = "verb-output")]
pub verb_output: Option<PathBuf>,
@@ -148,7 +148,7 @@ pub struct Args {
#[arg(short, long, value_name = "cmd")]
pub cmd: Option<String>,
- /// Whether to have styles and colors (default is usually OK)
+ /// Whether to have styles and colors
#[arg(long, default_value="auto", value_name = "color")]
pub color: TriBool,
@@ -160,7 +160,7 @@ pub struct Args {
#[arg(long)]
pub install: bool,
- /// Where to write the produced cmd (if any)
+ /// Manually set installation state
#[arg(long, value_name = "state")]
pub set_install_state: Option<CliShellInstallState>,
diff --git a/src/cli/mod.rs b/src/cli/mod.rs
index f7cfc22..934e7ac 100644
--- a/src/cli/mod.rs
+++ b/src/cli/mod.rs
@@ -56,6 +56,7 @@ pub fn run() -> Result<Option<Launchable>, ProgramError> {
Printer::new(Args::command())
.with_max_width(140)
.with("introduction", INTRO)
+ .with("options", clap_help::TEMPLATE_OPTIONS_MERGED_VALUE)
.without("author")
.print_help();
must_quit = true;