{"record":{"id":"8bf06905445cee37","repo":"gastownhall/beads","slug":"unknown-argument-q-did-you-mean-q-or-bd-s","errorCode":null,"errorMessage":"unknown argument %q; did you mean %q or 'bd %s'?","messagePattern":"unknown argument %q; did you mean %q or 'bd (.+?)'\\?","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/bd/list.go","lineNumber":163,"sourceCode":"\t\"all\":     \"--all\",\n\t\"long\":    \"--long\",\n\t\"watch\":   \"--watch\",\n\t\"pretty\":  \"--pretty\",\n\t\"pinned\":  \"--pinned\",\n\t\"overdue\": \"--overdue\",\n}\n\nvar listCmd = &cobra.Command{\n\tUse:     \"list\",\n\tGroupID: \"issues\",\n\tShort:   \"List issues\",\n\tArgs: func(cmd *cobra.Command, args []string) error {\n\t\tif len(args) == 0 {\n\t\t\treturn nil\n\t\t}\n\t\tfor _, arg := range args {\n\t\t\tif hint, ok := knownListFlags[arg]; ok {\n\t\t\t\treturn fmt.Errorf(\"unknown argument %q; did you mean %q or 'bd %s'?\", arg, hint, arg)\n\t\t\t}\n\t\t}\n\t\treturn fmt.Errorf(\"bd list does not accept positional arguments; use flags instead (see bd list --help)\")\n\t},\n\tSilenceUsage:  true,\n\tSilenceErrors: true,\n\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\tevt := metrics.NewCommandEvent(\"list\")\n\t\tdefer func() {\n\t\t\tif c := metrics.Global(); c != nil {\n\t\t\t\tc.CloseEventAndAdd(evt)\n\t\t\t}\n\t\t}()\n\n\t\treturn runListCore(cmd, args)\n\t},\n}\n","sourceCodeStart":145,"sourceCodeEnd":181,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/cmd/bd/list.go#L145-L181","documentation":"bd list's Args validator rejects any positional argument that matches a known old flag name, offering the new flag spelling and the 'bd <arg>' subcommand as alternatives. It exists to catch users who migrated from versions where things like 'blocked' were flags on list. The error is surfaced through cobra since SilenceErrors is true (handled by the root command's error printer).","triggerScenarios":"Running `bd list <arg>` where <arg> is a key in knownListFlags (e.g. a legacy flag name like 'blocked' or 'unassigned'). The Args function only runs when at least one positional arg is given.","commonSituations":"Users upgrading bd and typing old flag syntax (`bd list ready` instead of `bd list --ready`), or trying to pass an issue ID/substring to list expecting grep-like filtering.","solutions":["Use the suggested flag: `bd list --<hint>` as shown in the message","Use the suggested subcommand: `bd <arg>` (e.g. `bd blocked`)","Run `bd list --help` to see the current flag set","For filtering by text, use `bd list --search <term>` or pipe through grep"],"exampleFix":"// before\nbd list blocked\n// after\nbd list --blocked   # or: bd blocked","handlingStrategy":"validation","validationCode":"// In scripts, prefer flags/subcommands over positional args to bd list\nif [[ \"$1\" == \"blocked\" ]]; then set -- --blocked; fi\nbd list \"$@\"","typeGuard":null,"tryCatchPattern":"// Check exit output for 'unknown argument' and retry with the hinted flag\nif ! out=$(bd list \"$@\" 2>&1); then\n  echo \"$out\"; echo \"bd list is flag-only; see bd list --help\"\nfi","preventionTips":["Always pass list filters as --flags, never positionals","Use `bd blocked`-style subcommands instead of legacy list flags","After upgrading bd, re-check scripts against `bd list --help`"],"tags":["cli","argument-parsing","cobra"],"backgroundTag":"unknown-cli-argument","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}