use clap::Command;
use brontes::Config;
#[test]
fn omctl_cost_by_cell_list_naming() {
let root = Command::new("omnistrate-ctl").subcommand(
Command::new("cost").subcommand_required(true).subcommand(
Command::new("by-cell")
.subcommand_required(true)
.subcommand(Command::new("list").about("List by cell")),
),
);
let cfg = Config::default().tool_name_prefix("omctl");
let tools = brontes::generate_tools(&root, &cfg).expect("generate_tools should succeed");
let names: Vec<&str> = tools.iter().map(|t| t.name.as_ref()).collect();
assert!(
names.contains(&"omctl_cost_by-cell_list"),
"expected omctl_cost_by-cell_list in {names:?}"
);
}
#[test]
fn myapp_default_prefix_no_explicit_setting() {
let root = Command::new("myapp").subcommand(
Command::new("mcp")
.about("MCP business service")
.subcommand(Command::new("install").about("Install MCP")),
);
let cfg = Config::default().command_name("agent");
let tools = brontes::generate_tools(&root, &cfg).expect("generate_tools should succeed");
let names: Vec<&str> = tools.iter().map(|t| t.name.as_ref()).collect();
assert!(
names.contains(&"myapp_mcp_install"),
"expected myapp_mcp_install in {names:?}"
);
}