{"record":{"id":"e4dfed132b35706b","repo":"Morganamilo/paru","slug":"unknown-option-command-line","errorCode":null,"errorMessage":"unknown option -{}","messagePattern":"unknown option -(.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/command_line.rs","lineNumber":376,"sourceCode":"                    Ok(k) => Sign::Key(k.to_string()),\n                    Err(_) => Sign::Yes,\n                }\n            }\n            Arg::Long(\"nokeeprepocache\") => self.keep_repo_cache = false,\n            Arg::Long(\"keeprepocache\") => self.keep_repo_cache = true,\n            Arg::Long(\"signdb\") => {\n                self.sign_db = match value {\n                    Ok(k) => Sign::Key(k.to_string()),\n                    Err(_) => Sign::Yes,\n                }\n            }\n            Arg::Long(\"nosign\") => self.sign = Sign::No,\n            Arg::Long(\"nosigndb\") => self.sign_db = Sign::No,\n            Arg::Long(a) if !arg.is_pacman_arg() && !arg.is_pacman_global() => {\n                bail!(tr!(\"unknown option --{}\", a))\n            }\n            Arg::Short(a) if !arg.is_pacman_arg() && !arg.is_pacman_global() => {\n                bail!(tr!(\"unknown option -{}\", a))\n            }\n            _ => (),\n        }\n\n        match takes_value(arg) {\n            TakesValue::No if forced => bail!(tr!(\"option {} does not allow a value\", arg)),\n            _ => (),\n        }\n\n        Ok(())\n    }\n}\n\nfn split_whitespace(s: &str) -> Vec<String> {\n    s.split_whitespace().map(|s| s.to_string()).collect()\n}\n\nfn takes_value(arg: Arg) -> TakesValue {","sourceCodeStart":358,"sourceCodeEnd":394,"githubUrl":"https://github.com/Morganamilo/paru/blob/9ac3578807a87858651e81a02586ceb947686e7c/src/command_line.rs#L358-L394","documentation":"This error is raised from handle_arg (src/command_line.rs), reached via parse_arg, when the user supplied a short-form option that is not in the program's known option table. It fires in the fall-through arm of the Arg match: after parsing the single-character flag name out of a '-x' style token, handle_arg dispatches to the arm for each known short option, and an unrecognized character falls through to this bail. It is a usage/typo error (wrong or removed flag, or a value accidentally glued to a '-' such as '-foo' being read as '-f' plus 'oo'), so it terminates the parse before any configuration is applied.","triggerScenarios":"Passing an unrecognized short flag such as `-z` or `-X` on the command line; combining grouped short flags where one letter is invalid (e.g. `-abc` when `-c` is unknown).","commonSituations":"Typos in short flags; muscle-memory flags from pacman/yay that this tool does not implement; outdated scripts.","solutions":["Verify the short flag against `--help` output","Replace the invalid short flag with the supported equivalent (often the long form)","Update scripts referencing flags removed in newer versions"],"exampleFix":"// before\nparu -Z stats\n// after\nparu --stats","handlingStrategy":"validation","validationCode":"function is_known_short_flag(flag: string, known: Set<string>): boolean {\n  return [...flag.replace(/^-/, '')].every(c => known.has(c));\n}","typeGuard":null,"tryCatchPattern":"match cli::parse(&args) {\n    Err(e) if e.to_string().starts_with(\"unknown option -\") => {\n        eprintln!(\"{} — check --help for valid short flags\", e);\n        std::process::exit(2);\n    }\n    Err(e) => return Err(e),\n    Ok(cmd) => cmd.run(),\n}","preventionTips":["Verify grouped short flags letter-by-letter against --help","Prefer long flags in scripts for readability and easier diffing","Test wrapper scripts against the pinned tool version"],"tags":["cli","unknown-option","short-flag"],"backgroundTag":"invalid-cli-argument","analyzedSha":"9ac3578807a87858651e81a02586ceb947686e7c","analyzedAt":"2026-09-12T04:57:59.861Z","contentChangedAt":"2026-09-12T04:57:59.861Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}