Show real mapping grammar in --help, make --via repeatable, trim comments
- -l/-r/-d now show their actual grammar as the clap value name (<[BIND:]PORT:HOST:PORT>, <[BIND:]PORT>) instead of a generic <SPEC>, matching vmic's convention of showing real syntax in --help. The grammar is no longer also repeated in the flag's help text, since the value name already carries it. - --via changes from a single comma-separated flag to a repeatable one (Vec<String> + value_delimiter = ','), so both `--via a --via b` and `--via a,b` work and can be mixed. commands/mod.rs's edits_from_mapping no longer needs to split the string itself - clap does it. - Trimmed CLI help text that restated grammar/rationale already covered by the value name or by --via being required. - Normalized code comments for tone/format consistency: dropped cross-references to vmic's own internals as justification (this codebase should read as self-contained), removed markdown-style *emphasis* asterisks that don't render in plain comments, tightened several run-on sentences into plain declarative ones, and fixed one comment in wipe.rs that inaccurately described close_instance's force path (it sends SIGKILL, not SIGTERM). - spec/porthole-spec.md's --via row updated to document the repeatable form alongside comma-separated. Cargo.toml/Cargo.lock/atomic.rs also carry an external toml crate bump and formatting pass picked up from the working tree.
This commit is contained in:
21
src/cli.rs
21
src/cli.rs
@@ -54,24 +54,23 @@ pub enum Commands {
|
||||
/// struct (`#[command(flatten)]`ed into both) so the two can never drift.
|
||||
#[derive(Args, Default)]
|
||||
pub struct MappingArgs {
|
||||
/// Local forward: your machine -> remote. [bind:]port:host:hostport
|
||||
#[arg(short, long, value_name = "SPEC")]
|
||||
/// Local forward: your machine -> remote.
|
||||
#[arg(short, long, value_name = "[BIND:]PORT:HOST:PORT")]
|
||||
pub local: Option<String>,
|
||||
|
||||
/// Remote forward: remote -> your machine. [bind:]port:host:hostport
|
||||
#[arg(short, long, value_name = "SPEC")]
|
||||
/// Remote forward: remote -> your machine.
|
||||
#[arg(short, long, value_name = "[BIND:]PORT:HOST:PORT")]
|
||||
pub remote: Option<String>,
|
||||
|
||||
/// Dynamic forward (SOCKS proxy). [bind:]port
|
||||
#[arg(short, long, value_name = "SPEC")]
|
||||
/// Dynamic forward (SOCKS proxy).
|
||||
#[arg(short, long, value_name = "[BIND:]PORT")]
|
||||
pub dynamic: Option<String>,
|
||||
|
||||
/// 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>,
|
||||
/// SSH hop chain: jump hosts plus the final connection target.
|
||||
#[arg(long, value_name = "[USER@]HOST[:PORT]", value_delimiter = ',')]
|
||||
pub via: Vec<String>,
|
||||
|
||||
/// Default user for the target and any --via hop without its own.
|
||||
/// Default user for the target and any hop without one.
|
||||
#[arg(short, long, value_name = "USER")]
|
||||
pub user: Option<String>,
|
||||
|
||||
|
||||
Reference in New Issue
Block a user