{"record":{"id":"8b5662c8e25661d7","repo":"Hmbown/CodeWhale","slug":"http-and-mobile-are-mutually-exclusive-choose","errorCode":null,"errorMessage":"--http and --mobile are mutually exclusive; choose one","messagePattern":"--http and --mobile are mutually exclusive; choose one","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/tui/src/lib.rs","lineNumber":1401,"sourceCode":"struct ServeBindHost {\n    host: String,\n}\n\nfn resolve_serve_bind_host(_mobile: bool, host: Option<String>) -> ServeBindHost {\n    ServeBindHost {\n        host: host.unwrap_or_else(|| \"127.0.0.1\".to_string()),\n    }\n}\n\nfn validate_serve_mode_selection(\n    mcp: bool,\n    http: bool,\n    mobile: bool,\n    web: bool,\n    acp: bool,\n) -> Result<bool> {\n    if http && mobile {\n        bail!(\"--http and --mobile are mutually exclusive; choose one\");\n    }\n    if web && (http || mobile) {\n        bail!(\"--web is mutually exclusive with --http and --mobile\");\n    }\n    let http_selected = http || mobile || web;\n    let selected_modes = [mcp, http_selected, acp]\n        .into_iter()\n        .filter(|selected| *selected)\n        .count();\n    if selected_modes != 1 {\n        bail!(\"Choose exactly one server mode: --mcp, --http/--mobile/--web, or --acp\");\n    }\n    Ok(http_selected)\n}\n\n#[derive(Subcommand, Debug, Clone)]\nenum McpCommand {\n    /// List configured MCP servers","sourceCodeStart":1383,"sourceCodeEnd":1419,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/tui/src/lib.rs#L1383-L1419","documentation":"Server-mode selection validates flag combinations before starting any server. Passing both `--http` and `--mobile` is rejected up front because they select overlapping but distinct HTTP-serving modes and only one serving mode may be chosen.","triggerScenarios":"Invoking a serve/server subcommand with both `--http` and `--mobile` set (e.g. `codewhale serve --http --mobile`).","commonSituations":"Copy-pasting two example command lines together; scripting that always appends both flags; misunderstanding --mobile as a modifier of --http rather than an alternative.","solutions":["Pass only one of --http or --mobile","If mobile support was intended, use --mobile alone (it implies the HTTP mode path)","Review the script/alias that concatenates flags and drop the duplicate"],"exampleFix":"// before\ncodewhale serve --http --mobile\n// after\ncodewhale serve --mobile","handlingStrategy":"validation","validationCode":"if http && mobile { eprintln!(\"choose one of --http/--mobile\"); std::process::exit(2); }","typeGuard":null,"tryCatchPattern":"match result { Err(e) if e.to_string().contains(\"mutually exclusive\") => { eprintln!(\"{}\", e); std::process::exit(2); }, other => other? }","preventionTips":["Build command lines from one mode flag variable, never concatenated examples","Grep wrapper scripts for duplicated server-mode flags","Remember --mobile is an alternative to --http, not an add-on"],"tags":["cli","flags","server"],"backgroundTag":"mutually-exclusive-flags","analyzedSha":"73e0f67d83c59909b571efdfc88c4bc28c309cb1","analyzedAt":"2026-09-22T01:30:00.501Z","contentChangedAt":"2026-09-22T01:30:00.501Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}