{"record":{"id":"81bcc2ed1af6bcfa","repo":"Hmbown/CodeWhale","slug":"usage-network-list-allow-host-deny-host-rem","errorCode":null,"errorMessage":"Usage: /network [list|allow <host>|deny <host>|remove <host>|default <allow|deny|prompt>]","messagePattern":"Usage: /network \\[list\\|allow <host>\\|deny <host>\\|remove <host>\\|default <allow\\|deny\\|prompt>\\]","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"info","filePath":"crates/tui/src/commands/groups/utility/network.rs","lineNumber":77,"sourceCode":"            }\n            let host = normalize_host_arg(host_arg)?;\n            let edit = match command.as_str() {\n                \"allow\" => NetworkEdit::Allow,\n                \"deny\" => NetworkEdit::Deny,\n                _ => NetworkEdit::Remove,\n            };\n            update_host(edit, &host)\n        }\n        \"default\" => {\n            let Some(value) = parts.next() else {\n                bail!(\"Usage: /network default <allow|deny|prompt>\");\n            };\n            if parts.next().is_some() {\n                bail!(\"Usage: /network default <allow|deny|prompt>\");\n            }\n            update_default(value)\n        }\n        _ => bail!(usage()),\n    }\n}\n\nfn usage() -> &'static str {\n    \"Usage: /network [list|allow <host>|deny <host>|remove <host>|default <allow|deny|prompt>]\"\n}\n\n#[derive(Clone, Copy)]\nenum NetworkEdit {\n    Allow,\n    Deny,\n    Remove,\n}\n\n/// Resolve the active config document path through the leaf configuration\n/// crate (acyclic; no TUI persistence helper).\nfn config_toml_path() -> anyhow::Result<PathBuf> {\n    codewhale_config::resolve_config_path(None)","sourceCodeStart":59,"sourceCodeEnd":95,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/tui/src/commands/groups/utility/network.rs#L59-L95","documentation":"The fallback arm of network_inner: any subcommand other than list/allow/deny/remove/forget/default (or malformed top-level input) hits `bail!(usage())`, returning the full command usage string as the error. It is the generic bad-invocation guard for the /network command.","triggerScenarios":"Running `/network foo`, a misspelled subcommand like `/network alow github.com`, or leftover unexpected tokens routed to the catch-all arm.","commonSituations":"Typos in subcommand names; assuming flags like `--add` exist; translating shell firewall commands (ufw/iptables syntax) into /network.","solutions":["Use one of: /network, /network list, /network allow <host>, /network deny <host>, /network remove <host>, /network default <allow|deny|prompt>","Check spelling of the subcommand","Run plain `/network` to list current rules"],"exampleFix":"// before\n/network alow github.com\n// after\n/network allow github.com","handlingStrategy":"validation","validationCode":"const VALID = ['list','allow','deny','remove','forget','default'];\nif (!VALID.includes(subcommand)) throw new Error(usage());","typeGuard":null,"tryCatchPattern":"try { run(input); } catch (e) { if (String(e).startsWith('Usage: /network [')) printUsage(e.message); }","preventionTips":["Check subcommand spelling before running","Consult the usage string: list, allow <host>, deny <host>, remove <host>, default <policy>","No flags like --add exist; only the listed subcommands"],"tags":["cli","usage","invalid-command"],"backgroundTag":"invalid-cli-argument","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"}