{"record":{"id":"e9679ab5a26439d0","repo":"Morganamilo/paru","slug":"no-operation-specified-use-h-for-help","errorCode":null,"errorMessage":"no operation specified (use -h for help)","messagePattern":"no operation specified \\(use -h for help\\)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/lib.rs","lineNumber":313,"sourceCode":"        let unneeded = util::unneeded_pkgs(config, !config.optional);\n        if !unneeded.is_empty() {\n            let mut args = config.pacman_args();\n            args.remove(\"c\").remove(\"clean\");\n            args.remove(\"o\");\n            args.targets = unneeded;\n            args.op = \"remove\";\n            Ok(exec::pacman(config, &args)?.code())\n        } else {\n            printtr!(\" there is nothing to do\");\n            Ok(0)\n        }\n    } else if !config.targets.is_empty() {\n        config.interactive = true;\n        config.need_root = true;\n        handle_sync(config).await?;\n        Ok(0)\n    } else {\n        bail!(tr!(\"no operation specified (use -h for help)\"));\n    }\n}\n\nfn handle_remove(config: &mut Config) -> Result<i32> {\n    remove::remove(config)\n}\n\nasync fn handle_test(config: &Config) -> Result<i32> {\n    if config.aur_filter {\n        sync::filter(config).await\n    } else {\n        Ok(exec::pacman(config, &config.args)?.code())\n    }\n}\n\nasync fn handle_sync(config: &mut Config) -> Result<i32> {\n    if config.targets.iter().any(|t| t.starts_with(\"./\")) {\n        let repo = PkgbuildRepo::from_cwd(config)?;","sourceCodeStart":295,"sourceCodeEnd":331,"githubUrl":"https://github.com/Morganamilo/paru/blob/9ac3578807a87858651e81a02586ceb947686e7c/src/lib.rs#L295-L331","documentation":"handle_default handles paru invocations with no recognized operation flag. If targets were given, it degrades to an interactive sync (install) of those targets; otherwise there is literally nothing to do, so it bails with 'no operation specified', mirroring pacman's behavior.","triggerScenarios":"Running bare `paru` (or `paru` plus only options but no -S/-R/-Q/etc. operation and no targets) such that handle_cmd dispatches to handle_default with no targets and no op.","commonSituations":"Typing `paru` alone expecting an interactive menu; wrapping paru where the operation flag got lost (quoting/alias issues); scripts calling `paru $FLAGS` with FLAGS empty.","solutions":["Specify an operation and targets, e.g. `paru -S <pkg>` or `paru` alone is never enough","Use `paru -Syu` for a full sync+upgrade, the most common intent","If you wanted the interactive selector, pass targets: `paru <search-terms>`","Check aliases/wrappers so operation flags aren't dropped"],"exampleFix":"// before\n$ paru\nno operation specified (use -h for help)\n// after\n$ paru -Syu    # or: paru firefox","handlingStrategy":"validation","validationCode":"if op.is_none() && targets.is_empty() {\n    eprintln!(\"usage: paru <operation> [targets]\");\n    std::process::exit(1);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always include an operation flag in scripts (e.g. -S, -Syu)","Avoid bare `paru` invocations in wrappers","Guard variable-expanded flags: paru \"${FLAGS:?}\" ..."],"tags":["cli","missing-argument","usage"],"backgroundTag":"missing-required-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"}