ci / rust (push) Successful in 15m43s
New `crates/maestro-tui/` library behind a `tui` cargo feature on the umbrella binary (default-on). Ships a clap-derive `TuiArgs` and a `run()` stub that returns `NotImplemented` — exercises the full dispatch path so phases 2+ can fill in the catalog, session liveness, widgets, and event loop without touching scaffolding. Acceptance: - `cargo build -p maestro --features tui` succeeds - `maestro tui` prints "maestro: not implemented" and exits 1 - `cargo test -p maestro-tui` passes (2 clap-parse tests) - `cargo fmt --check` + `cargo clippy --all-targets --features tui -- -D warnings` clean Phase 1 of the Maestro TUI epic (NAP-275); plan in `docs/superpowers/plans/2026-05-28-maestro-tui.md`.
41 lines
1.0 KiB
Rust
41 lines
1.0 KiB
Rust
//! Clap-derive subcommand definition for `maestro tui`.
|
|
|
|
#[derive(Debug, clap::Args)]
|
|
pub struct TuiArgs {
|
|
/// Override the local daemon's HTTP base URL (default `http://127.0.0.1:7070`).
|
|
#[arg(long, env = "MAESTRO_DAEMON_URL")]
|
|
pub daemon_url: Option<String>,
|
|
}
|
|
|
|
#[cfg(test)]
|
|
mod tests {
|
|
use super::*;
|
|
use clap::Parser;
|
|
|
|
#[derive(Debug, Parser)]
|
|
struct Harness {
|
|
#[command(subcommand)]
|
|
cmd: Cmd,
|
|
}
|
|
|
|
#[derive(Debug, clap::Subcommand)]
|
|
enum Cmd {
|
|
Tui(TuiArgs),
|
|
}
|
|
|
|
#[test]
|
|
fn parses_with_daemon_url() {
|
|
let h = Harness::try_parse_from(["maestro", "tui", "--daemon-url", "http://10.0.0.1:7070"])
|
|
.unwrap();
|
|
let Cmd::Tui(args) = h.cmd;
|
|
assert_eq!(args.daemon_url.as_deref(), Some("http://10.0.0.1:7070"));
|
|
}
|
|
|
|
#[test]
|
|
fn parses_without_daemon_url() {
|
|
let h = Harness::try_parse_from(["maestro", "tui"]).unwrap();
|
|
let Cmd::Tui(args) = h.cmd;
|
|
assert!(args.daemon_url.is_none());
|
|
}
|
|
}
|