{"record":{"id":"aed4cb77d583f2ec","repo":"ipfs/kubo","slug":"the-verbose-and-quiet-options-can-not-be-used","errorCode":null,"errorMessage":"the --verbose and --quiet options can not be used at the same time","messagePattern":"the --verbose and --quiet options can not be used at the same time","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/commands/pin/pin.go","lineNumber":786,"sourceCode":"var verifyPinCmd = &cmds.Command{\n\tHelptext: cmds.HelpText{\n\t\tTagline: \"Verify that recursive pins are complete.\",\n\t},\n\tOptions: []cmds.Option{\n\t\tcmds.BoolOption(pinVerboseOptionName, \"Also write the hashes of non-broken pins.\"),\n\t\tcmds.BoolOption(pinQuietOptionName, \"q\", \"Write just hashes of broken pins.\"),\n\t},\n\tRun: func(req *cmds.Request, res cmds.ResponseEmitter, env cmds.Environment) error {\n\t\tn, err := cmdenv.GetNode(env)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tverbose, _ := req.Options[pinVerboseOptionName].(bool)\n\t\tquiet, _ := req.Options[pinQuietOptionName].(bool)\n\n\t\tif verbose && quiet {\n\t\t\treturn fmt.Errorf(\"the --verbose and --quiet options can not be used at the same time\")\n\t\t}\n\n\t\tenc, err := cmdenv.GetCidEncoder(req)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\topts := pinVerifyOpts{\n\t\t\texplain:   !quiet,\n\t\t\tincludeOk: verbose,\n\t\t}\n\t\tout, err := pinVerify(req.Context, n, opts, enc)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn res.Emit(out)\n\t},\n\tType: PinVerifyRes{},","sourceCodeStart":768,"sourceCodeEnd":804,"githubUrl":"https://github.com/ipfs/kubo/blob/329838acdfafae224582930457efe80aa217afc0/core/commands/pin/pin.go#L768-L804","documentation":"`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.","triggerScenarios":"`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.","commonSituations":"Wrapper scripts that build the flag list from config where both display options got enabled; users combining example commands from different sources.","solutions":["Drop `--verbose` if you want compact output (`--quiet`).","Drop `--quiet` if you want the detailed listing.","In scripts, make the two mutually exclusive in the flag-building logic (if/else).","Note `--stream` (`-s`) also changes output shape; pick one presentation mode."],"exampleFix":"// before\nargs := []string{\"pin\", \"ls\", \"--verbose\", \"--quiet\"}\n// after\nargs := []string{\"pin\", \"ls\"}\nif quiet { args = append(args, \"--quiet\") } else { args = append(args, \"--verbose\") }","handlingStrategy":"validation","validationCode":"if verbose && quiet {\n    return errors.New(\"--verbose and --quiet are mutually exclusive\")\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Build flag lists with if/else so only one display mode is set","Prefer --quiet for machine-readable output","Keep display flags out of shared config that both paths read"],"tags":["ipfs","cli","pinning","flag-validation"],"backgroundTag":"mutually-exclusive-flags","analyzedSha":"329838acdfafae224582930457efe80aa217afc0","analyzedAt":"2026-09-03T18:30:52.135Z","contentChangedAt":"2026-09-03T18:30:52.135Z","schemaVersion":2},"datasetVersion":"2026-09-11T00:17:11.886Z"}