ipfs/kubo · error

the --verbose and --quiet options can not be used at the sam

Error message

the --verbose and --quiet options can not be used at the same time

What it means

`ipfs pin ls` supports both a human-oriented `--verbose`-style output and a machine-friendly `--quiet` output; these presentation modes are mutually exclusive. The command's pre-run check rejects a request where both boolean options are true, since the output format would be ambiguous.

Source

Thrown at core/commands/pin/pin.go:786

var verifyPinCmd = &cmds.Command{
	Helptext: cmds.HelpText{
		Tagline: "Verify that recursive pins are complete.",
	},
	Options: []cmds.Option{
		cmds.BoolOption(pinVerboseOptionName, "Also write the hashes of non-broken pins."),
		cmds.BoolOption(pinQuietOptionName, "q", "Write just hashes of broken pins."),
	},
	Run: func(req *cmds.Request, res cmds.ResponseEmitter, env cmds.Environment) error {
		n, err := cmdenv.GetNode(env)
		if err != nil {
			return err
		}

		verbose, _ := req.Options[pinVerboseOptionName].(bool)
		quiet, _ := req.Options[pinQuietOptionName].(bool)

		if verbose && quiet {
			return fmt.Errorf("the --verbose and --quiet options can not be used at the same time")
		}

		enc, err := cmdenv.GetCidEncoder(req)
		if err != nil {
			return err
		}

		opts := pinVerifyOpts{
			explain:   !quiet,
			includeOk: verbose,
		}
		out, err := pinVerify(req.Context, n, opts, enc)
		if err != nil {
			return err
		}
		return res.Emit(out)
	},
	Type: PinVerifyRes{},

View on GitHub (pinned to 329838acdf)

Solutions

  1. Drop `--verbose` if you want compact output (`--quiet`).
  2. Drop `--quiet` if you want the detailed listing.
  3. In scripts, make the two mutually exclusive in the flag-building logic (if/else).
  4. Note `--stream` (`-s`) also changes output shape; pick one presentation mode.

Example fix

// before
args := []string{"pin", "ls", "--verbose", "--quiet"}
// after
args := []string{"pin", "ls"}
if quiet { args = append(args, "--quiet") } else { args = append(args, "--verbose") }
Defensive patterns

Strategy: validation

Validate before calling

if verbose && quiet {
    return errors.New("--verbose and --quiet are mutually exclusive")
}

Prevention

When it happens

Trigger: `ipfs pin ls --verbose --quiet` on the CLI; RPC `pin/ls` calls that set both `quiet` and `verbose` options to true; scripts appending flags conditionally and accidentally enabling both.

Common situations: Wrapper scripts that build the flag list from config where both display options got enabled; users combining example commands from different sources.

Understand the failure class

Background: "mutually exclusive" flag errors: what "can't supply both nx and xx", "--raw is not compatible with -i" and "cannot be used with" mean, and how to fix them — this error's family across 29 libraries.

Related errors


AI-assisted analysis of ipfs/kubo@329838acdf (2026-09-03). Data as JSON: /api/errors/aed4cb77d583f2ec. Report an issue: GitHub.