Enable auto-wrapping of the help message

This commit is contained in:
Marcin Kulik
2025-06-19 13:32:12 +02:00
parent 9b8b26e6a9
commit 19bcb65e25
3 changed files with 14 additions and 4 deletions

11
Cargo.lock generated
View File

@@ -373,6 +373,7 @@ dependencies = [
"anstyle",
"clap_lex",
"strsim",
"terminal_size",
]
[[package]]
@@ -1876,6 +1877,16 @@ dependencies = [
"windows-sys 0.59.0",
]
[[package]]
name = "terminal_size"
version = "0.4.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "45c6481c4829e4cc63825e62c49186a34538b7b2750b73b266581ffb612fb5ed"
dependencies = [
"rustix 1.0.7",
"windows-sys 0.59.0",
]
[[package]]
name = "thiserror"
version = "2.0.12"

View File

@@ -18,7 +18,7 @@ anyhow = "1.0.98"
nix = { version = "0.30", features = ["fs", "term", "process", "signal", "poll"] }
serde = { version = "1.0.219", features = ["derive"] }
serde_json = "1.0.140"
clap = { version = "4.5.37", features = ["derive"] }
clap = { version = "4.5.37", features = ["derive", "wrap_help"] }
signal-hook = { version = "0.3.17", default-features = false }
uuid = { version = "1.6.1", features = ["v4"] }
reqwest = { version = "0.12.15", default-features = false, features = ["blocking", "rustls-tls-native-roots", "multipart", "gzip", "json"] }
@@ -45,7 +45,7 @@ async-trait = "0.1.88"
signal-hook-tokio = { version = "0.3.1", features = ["futures-v0_3"] }
[build-dependencies]
clap = { version = "4.5.37", features = ["derive"] }
clap = { version = "4.5.37", features = ["derive", "wrap_help"] }
clap_complete = "4.5.48"
clap_mangen = "0.2.26"
url = "2.5.0"

View File

@@ -8,8 +8,7 @@ pub const DEFAULT_LISTEN_ADDR: &str = "127.0.0.1:8080";
#[derive(Debug, Parser)]
#[clap(author, version, about)]
#[command(name = "asciinema")]
#[command(infer_subcommands = true)]
#[command(name = "asciinema", max_term_width = 100, infer_subcommands = true)]
pub struct Cli {
#[command(subcommand)]
pub command: Commands,