{"record":{"id":"813bcccbb3e54bd4","repo":"astrid-runtime/astrid","slug":"unknown-argument-unknown-use-help","errorCode":null,"errorMessage":"unknown argument {unknown:?}; use --help","messagePattern":"unknown argument (.+?); use --help","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/astrid-storage-chunker-evidence/src/main.rs","lineNumber":183,"sourceCode":"            \"--target-kib\" => {\n                let target = args\n                    .next()\n                    .ok_or_else(|| anyhow::anyhow!(\"--target-kib requires an integer\"))?\n                    .parse::<u32>()\n                    .context(\"parse --target-kib\")?;\n                targets_kib.push(target);\n            },\n            \"--output\" => {\n                let path = args\n                    .next()\n                    .ok_or_else(|| anyhow::anyhow!(\"--output requires a path\"))?;\n                output = Some(PathBuf::from(path));\n            },\n            \"-h\" | \"--help\" => {\n                print_help();\n                std::process::exit(0);\n            },\n            unknown => bail!(\"unknown argument {unknown:?}; use --help\"),\n        }\n    }\n    if targets_kib.is_empty() {\n        targets_kib.push(64);\n    }\n    targets_kib.sort_unstable();\n    targets_kib.dedup();\n    Ok(Options {\n        corpus_specs,\n        version_chain_specs,\n        git_history_specs,\n        include_synthetic,\n        sketch_only,\n        targets_kib,\n        output,\n    })\n}\n","sourceCodeStart":165,"sourceCodeEnd":201,"githubUrl":"https://github.com/astrid-runtime/astrid/blob/affd8760f44190dbdfbec23403f4c4b642c33112/crates/astrid-storage-chunker-evidence/src/main.rs#L165-L201","documentation":"CLI argument fallback arm of parse_options in the chunker-evidence utility binary: a flag was passed that matches none of the recognized options (--target-kib, --output, --help, etc.). A pure argument-validation error in a developer tool; the message directs the user to --help for the accepted set.","triggerScenarios":"Invoking the binary with a misspelled flag (e.g. `--corpra`), a flag from a different tool, an option missing its `--` prefix, or a positional value the parser doesn't accept.","commonSituations":"Typos, translating flags from similar benchmark tools, outdated wrapper scripts referencing removed options, or forgetting that `=`-style values must match documented forms.","solutions":["Run the binary with `--help` to list accepted flags and fix the typo","Update wrapper/CI scripts to the current flag names","If a flag was recently renamed, consult the changelog and switch to the new spelling"],"exampleFix":"// before\nbin --targets=64,128\n// after\nbin --help            # check accepted form\nbin --targets 64 128  # per documented usage","handlingStrategy":"try-catch","validationCode":"const KNOWN: [&str; 8] = [\"--targets\", \"--corpus\", \"--git-history\", \"--no-synthetic\", \"--output\", \"--help\", \"-h\", \"--version\"];\nlet unknown: Vec<_> = args.iter().filter(|a| a.starts_with(\"--\") && !KNOWN.contains(&a.as_str())).collect();\nassert!(unknown.is_empty(), \"unknown flags: {unknown:?}\");","typeGuard":null,"tryCatchPattern":"match run_cli(args) {\n    Err(e) if e.to_string().starts_with(\"unknown argument\") => {\n        eprintln!(\"{e}; printing help\");\n        print_usage_and_exit(2);\n    }\n    other => other,\n}","preventionTips":["Diff wrapper scripts against `--help` output after tool upgrades","Enable shell completion or a curated flag list in CI pipelines","Avoid copy-pasting flags from other benchmark tools"],"tags":["rust","cli","argument-parsing","user-input"],"backgroundTag":"invalid-cli-argument","analyzedSha":"affd8760f44190dbdfbec23403f4c4b642c33112","analyzedAt":"2026-09-09T21:28:12.402Z","contentChangedAt":"2026-09-09T21:28:12.402Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}