{"record":{"id":"5a95f7e366f91611","repo":"Jguer/yay","slug":"invalid-option-deps-and-explicit-may-not","errorCode":null,"errorMessage":"invalid option: '--deps' and '--explicit' may not be used together","messagePattern":"invalid option: '--deps' and '--explicit' may not be used together","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd.go","lineNumber":285,"sourceCode":"\tcase \"Y\", \"yay\":\n\t\treturn handleYay(ctx, run, cmdArgs, run.CmdBuilder,\n\t\t\tdbExecutor, run.QueryBuilder)\n\tcase \"W\", \"web\":\n\t\treturn handleWeb(ctx, run, cmdArgs)\n\t}\n\n\treturn errors.New(gotext.Get(\"unhandled operation\"))\n}\n\n// getFilter returns filter function which can keep packages which were only\n// explicitly installed or ones installed as dependencies for showing available\n// updates or their count.\nfunc getFilter(cmdArgs *parser.Arguments) (upgrade.Filter, error) {\n\tdeps, explicit := cmdArgs.ExistsArg(\"d\", \"deps\"), cmdArgs.ExistsArg(\"e\", \"explicit\")\n\n\tswitch {\n\tcase deps && explicit:\n\t\treturn nil, errors.New(gotext.Get(\"invalid option: '--deps' and '--explicit' may not be used together\"))\n\tcase deps:\n\t\treturn func(pkg *upgrade.Upgrade) bool {\n\t\t\treturn pkg.Reason == alpm.PkgReasonDepend\n\t\t}, nil\n\tcase explicit:\n\t\treturn func(pkg *upgrade.Upgrade) bool {\n\t\t\treturn pkg.Reason == alpm.PkgReasonExplicit\n\t\t}, nil\n\t}\n\n\treturn func(pkg *upgrade.Upgrade) bool {\n\t\treturn true\n\t}, nil\n}\n\nfunc handleQuery(ctx context.Context, run *runtime.Runtime, cmdArgs *parser.Arguments, dbExecutor db.Executor) error {\n\tif cmdArgs.ExistsArg(\"u\", \"upgrades\") {\n\t\tfilter, err := getFilter(cmdArgs)","sourceCodeStart":267,"sourceCodeEnd":303,"githubUrl":"https://github.com/Jguer/yay/blob/328f4b4939fb35f38c2f7c7ce3b8638a839bafa5/cmd.go#L267-L303","documentation":"Returned by getFilter when both the --deps (-d) and --explicit (-e) flags are set simultaneously. The two filters are mutually exclusive: a package cannot be both installed as a dependency and explicitly installed, so combining them would match nothing. This is an argument-validation guard on cmdArgs before any upgrade listing is produced.","triggerScenarios":"Thrown at cmd.go:285 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use only one of --deps or --explicit, not both","Remove the redundant flag from the command line and retry"],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"328f4b4939fb35f38c2f7c7ce3b8638a839bafa5","analyzedAt":"2026-09-07T16:45:12.608Z","contentChangedAt":"2026-09-07T16:45:12.608Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}