{"record":{"id":"17b991b83ad0179c","repo":"Morganamilo/paru","slug":"option-does-not-allow-a-value","errorCode":null,"errorMessage":"option {} does not allow a value","messagePattern":"option (.+?) does not allow a value","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/command_line.rs","lineNumber":382,"sourceCode":"            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 {\n    match arg {\n        Arg::Long(\"aururl\") => TakesValue::Required,\n        Arg::Long(\"aurrpcurl\") => TakesValue::Required,\n        Arg::Long(\"editor\") => TakesValue::Required,\n        Arg::Long(\"makepkg\") => TakesValue::Required,\n        Arg::Long(\"pacman\") => TakesValue::Required,","sourceCodeStart":364,"sourceCodeEnd":400,"githubUrl":"https://github.com/Morganamilo/paru/blob/9ac3578807a87858651e81a02586ceb947686e7c/src/command_line.rs#L364-L400","documentation":"The parser rejected a value attached to an option that does not accept one (`TakesValue::No`) when `forced` is set, bailing with 'option {} does not allow a value'. This happens when `parse_arg` forced a value onto a boolean-style flag.","triggerScenarios":"Passing `=value` or a following value to a flagless option, e.g. `--stats=true`, `--news=2`, or `--installdebug yes`; the value is only rejected when `forced` is true (value was explicitly attached/passed).","commonSituations":"Users habitually adding `=value` to boolean flags; scripts templating `--flag=${VAR}` where flag is boolean; confusion with GNU long-option `=` syntax.","solutions":["Remove the `=value` from the boolean flag: use `--stats` alone","Use the correct option that takes a value (e.g. `--limit 5`) instead of adding a value to a boolean one","Repeat boolean flags to increase counts where supported (e.g. `-w` for news count)"],"exampleFix":"// before\nparu --stats=true\n// after\nparu --stats","handlingStrategy":"validation","validationCode":"const NO_VALUE_FLAGS = new Set(['stats', 'news', 'installdebug', 'noinstalldebug', 'nosign', 'nosigndb']);\nfunction reject_valued_bools(args: string[]): string | null {\n  for (const a of args) {\n    const [name, val] = a.split('=');\n    if (val !== undefined && NO_VALUE_FLAGS.has(name.replace(/^--/, '')))\n      return `--${name} does not allow a value`;\n  }\n  return null;\n}","typeGuard":null,"tryCatchPattern":"if (let Err(e) = cli::parse(&args)) && e.to_string().contains(\"does not allow a value\") {\n    eprintln!(\"{} — drop the =value for boolean flags\", e);\n}","preventionTips":["Never append `=value` to boolean flags","Use repeated flags to change intensity (e.g. -w -w)","Lint wrapper scripts for `--flag=${VAR}` patterns against boolean flags"],"tags":["cli","argument-parsing","unexpected-value"],"backgroundTag":"invalid-flag-value","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"}