Match vmic's custom top-level --help renderer

Ports vmic's print_full_help (main.rs) verbatim in spirit: one line per
subcommand with its positional args inline, an indented per-flag block
underneath with globally-aligned columns, a separate Aliases section, and
NO_COLOR-aware coloring - so `porthole`/`porthole -h`/`porthole help` show
every subcommand's flags without drilling into each one's own --help,
matching vmic's actual rendered output exactly in structure.

Also shortened --via's clap value_name from the full grammar
([user@]host[:port][,...]) to HOPS - the long form blew out the column
alignment for every other flag's help text; the full grammar is still in
the flag's help string itself.

Dropped vmic's MULTI_CHAR_ALIASES workaround (for short flags like -sv
that clap can't express natively) since porthole has no multi-char short
flags today - add it back if one shows up.
This commit is contained in:
2026-08-13 16:13:02 +02:00
parent 0c9f0585fa
commit 4a8faf1131
3 changed files with 173 additions and 5 deletions

View File

@@ -66,9 +66,9 @@ pub struct MappingArgs {
#[arg(short, long, value_name = "SPEC")]
pub dynamic: Option<String>,
/// SSH hop chain, comma-separated; the last hop is the actual
/// connection target, any before it are -J jumps.
#[arg(long, value_name = "[user@]host[:port][,...]")]
/// SSH hop chain, comma-separated: [user@]host[:port][,...]. The last
/// hop is the actual connection target, any before it are -J jumps.
#[arg(long, value_name = "HOPS")]
pub via: Option<String>,
/// Default user for the target and any --via hop without its own.