{"record":{"id":"17fcab1f70dfefdf","repo":"microsoft/edit","slug":"unrecognized-arguments","errorCode":null,"errorMessage":"unrecognized arguments: {:?}","messagePattern":"unrecognized arguments: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/unicode-gen/src/main.rs","lineNumber":276,"sourceCode":"        eprint!(\"{HELP}\");\n        return Ok(());\n    }\n\n    let mut out = Output {\n        arg_lang: args.value_from_fn(\"--lang\", |arg| match arg {\n            \"c\" => Ok(Language::C),\n            \"rust\" => Ok(Language::Rust),\n            l => bail!(\"invalid language: \\\"{}\\\"\", l),\n        })?,\n        arg_extended: args.contains(\"--extended\"),\n        arg_no_ambiguous: args.contains(\"--no-ambiguous\"),\n        arg_line_breaks: args.contains(\"--line-breaks\"),\n        ..Default::default()\n    };\n    let arg_input = args.free_from_os_str(|s| -> Result<PathBuf, &'static str> { Ok(s.into()) })?;\n    let arg_remaining = args.finish();\n    if !arg_remaining.is_empty() {\n        bail!(\"unrecognized arguments: {:?}\", arg_remaining);\n    }\n\n    let input = std::fs::read_to_string(arg_input)?;\n    let doc = roxmltree::Document::parse(&input)?;\n    out.ucd = extract_values_from_ucd(&doc, &out)?;\n\n    // Find the best trie configuration over the given block sizes (2^2 - 2^8) and stages (4).\n    // More stages = Less size. The trajectory roughly follows a+b*c^stages, where c < 1.\n    // 4 still gives ~30% savings over 3 stages and going beyond 5 gives diminishing returns (<10%).\n    out.trie = build_best_trie(&out.ucd.values, 2, 8, 4);\n\n    // The joinRules above has 2 bits per value. This packs it into 32-bit integers to save space.\n    out.rules_gc = JOIN_RULES_GRAPHEME_CLUSTER\n        .iter()\n        .map(|t| {\n            let rules_gc_len = if out.arg_extended { t.len() } else { 16 };\n            t[..rules_gc_len].iter().map(|row| prepare_rules_row(row, 2, 3)).collect()\n        })","sourceCodeStart":258,"sourceCodeEnd":294,"githubUrl":"https://github.com/microsoft/edit/blob/826b4c097b6f14ba0a846dc56f2f0223a3aaf73a/crates/unicode-gen/src/main.rs#L258-L294","documentation":"After parsing known flags and the free input path, main calls args.finish() and fails if any unconsumed arguments remain. unicode-gen accepts a strict argument set; extra positional or unknown flags are rejected wholesale.","triggerScenarios":"Passing extra positional arguments (e.g. multiple UCD files when only one is accepted) or unknown flags like --verbose / -o out; also leftover arguments from a mistyped flag name (e.g. --langage which is not consumed).","commonSituations":"Copy-pasting command lines from other tools; passing output-file arguments that this generator does not support; typos in supported flags leaving both the typo and intended behavior unresolved.","solutions":["Remove the extra arguments; supply exactly one input file and only the supported flags (--lang, --extended, --no-ambiguous, --line-breaks).","Check for flag typos — an unrecognized flag name will land in the remaining set.","Consult the source (crates/unicode-gen/src/main.rs Output parsing) for the exact accepted flag list."],"exampleFix":"// before\nunicode-gen --lang=c --extended extra.txt GraphemeBreakProperty.txt\n// after\nunicode-gen --lang=c --extended GraphemeBreakProperty.txt","handlingStrategy":"validation","validationCode":"// enforce exact argc before invoking\nlet ucd_files: Vec<_> = std::env::args().skip(1).filter(|a| !a.starts_with(\"--\")).collect();\nif ucd_files.len() != 1 { eprintln!(\"expected exactly one UCD input file\"); std::process::exit(2); }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Pass exactly one UCD input file and only documented flags.","Avoid copy-pasting flags from other table generators; verify each flag exists in main.rs.","Run with only --lang plus the input path when unsure; add optional flags one at a time."],"tags":["cli","argument-parsing","usage-error"],"backgroundTag":"invalid-cli-argument","analyzedSha":"826b4c097b6f14ba0a846dc56f2f0223a3aaf73a","analyzedAt":"2026-09-06T13:30:05.543Z","contentChangedAt":"2026-09-06T13:30:05.543Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}