feat(cli): implement wraith connect subcommand with clap derive
All CLI flags from client.md: --server, --peer, --transport (default tcp), --identity, --socks5 (default 127.0.0.1:1080), --forward (repeatable), --remote-forward (repeatable), --proxy, --iroh-relay, --tls-server-name, --insecure. Env var defaults: WRAITH_SERVER, WRAITH_IDENTITY. Validates --server required for tcp/tls, --peer required for iroh, --identity required. Warns on --proxy with --transport tcp (ADR-019). Translates args to ConnectOptions and calls ClientSession::new(opts).run().await. Errors to stderr with non-zero exit.
This commit is contained in:
@@ -7,8 +7,15 @@ edition = "2021"
|
||||
name = "wraith"
|
||||
path = "src/main.rs"
|
||||
|
||||
[features]
|
||||
default = ["tls", "iroh"]
|
||||
tls = ["wraith-core/tls"]
|
||||
iroh = ["wraith-core/iroh", "dep:iroh", "dep:url"]
|
||||
|
||||
[dependencies]
|
||||
wraith-core = { path = "../wraith-core" }
|
||||
clap = { version = "4", features = ["derive"] }
|
||||
clap = { version = "4", features = ["derive", "env"] }
|
||||
tokio = { version = "1", features = ["full"] }
|
||||
anyhow = "1"
|
||||
anyhow = "1"
|
||||
iroh = { version = "0.34", optional = true }
|
||||
url = { version = "2", optional = true }
|
||||
Reference in New Issue
Block a user