Jguer/yay · error

invalid option: '--deps' and '--explicit' may not be used…

Error message

invalid option: '--deps' and '--explicit' may not be used together

What it means

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.

Solutions

  1. Use only one of --deps or --explicit, not both
  2. Remove the redundant flag from the command line and retry

When it happens

Trigger: Thrown at cmd.go:285 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of Jguer/yay@328f4b4939 (2026-09-07). Data as JSON: /api/errors/5a95f7e366f91611. Report an issue: GitHub.

Appendix: source

Thrown at cmd.go:285

	case "Y", "yay":
		return handleYay(ctx, run, cmdArgs, run.CmdBuilder,
			dbExecutor, run.QueryBuilder)
	case "W", "web":
		return handleWeb(ctx, run, cmdArgs)
	}

	return errors.New(gotext.Get("unhandled operation"))
}

// getFilter returns filter function which can keep packages which were only
// explicitly installed or ones installed as dependencies for showing available
// updates or their count.
func getFilter(cmdArgs *parser.Arguments) (upgrade.Filter, error) {
	deps, explicit := cmdArgs.ExistsArg("d", "deps"), cmdArgs.ExistsArg("e", "explicit")

	switch {
	case deps && explicit:
		return nil, errors.New(gotext.Get("invalid option: '--deps' and '--explicit' may not be used together"))
	case deps:
		return func(pkg *upgrade.Upgrade) bool {
			return pkg.Reason == alpm.PkgReasonDepend
		}, nil
	case explicit:
		return func(pkg *upgrade.Upgrade) bool {
			return pkg.Reason == alpm.PkgReasonExplicit
		}, nil
	}

	return func(pkg *upgrade.Upgrade) bool {
		return true
	}, nil
}

func handleQuery(ctx context.Context, run *runtime.Runtime, cmdArgs *parser.Arguments, dbExecutor db.Executor) error {
	if cmdArgs.ExistsArg("u", "upgrades") {
		filter, err := getFilter(cmdArgs)

View on GitHub (pinned to 328f4b4939)