{"record":{"id":"f2ad7f44651241dd","repo":"gastownhall/beads","slug":"bd-list-does-not-accept-positional-arguments-use","errorCode":null,"errorMessage":"bd list does not accept positional arguments; use flags instead (see bd list --help)","messagePattern":"bd list does not accept positional arguments; use flags instead \\(see bd list --help\\)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/bd/list.go","lineNumber":166,"sourceCode":"\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\n// runListCore runs the list query and rendering without emitting a metrics\n// event, so the caller owns emission: `bd list` emits \"list\" exactly once, and\n// the `bd children` alias emits \"children\" exactly once. children sets listCmd's","sourceCodeStart":148,"sourceCodeEnd":184,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/cmd/bd/list.go#L148-L184","documentation":"The generic branch of bd list's Args validator: list accepts no positional arguments at all, only flags. If an arg is not a recognized legacy flag, this error tells the user list is flag-only. It prevents silent misinterpretation of stray arguments.","triggerScenarios":"`bd list <anything>` where <anything> is not in knownListFlags — e.g. an issue ID, free text, a misspelled flag without dashes, or a quoted phrase.","commonSituations":"Typing `bd list bd-123` expecting to show one issue (use `bd show` instead), forgetting `--` on a flag (`bd list status open` instead of `--status open`), or shell-quoting mistakes.","solutions":["Remove the positional argument and use flags only","Use `bd show <id>` to view a single issue","Check `bd list --help` for correct flag names","Remember flags need the leading `--` (e.g. --status, --assignee)"],"exampleFix":"// before\nbd list status open\n// after\nbd list --status open","handlingStrategy":"validation","validationCode":"// Ensure list invocations contain only flag arguments\nfor a in \"$@\"; do case \"$a\" in -*) ;; *) echo \"positional arg not allowed: $a\" >&2; exit 2;; esac; done\nbd list \"$@\"","typeGuard":null,"tryCatchPattern":"// Detect the positional-args error and route to the right subcommand\nif ! out=$(bd list \"$@\" 2>&1); then\n  case \"$out\" in *\"does not accept positional arguments\"*) bd show \"$1\";; *) echo \"$out\";; esac\nfi","preventionTips":["Use `bd show <id>` for single issues, not `bd list <id>`","Quote flags correctly: --status open, not status open","Consult `bd list --help` when migrating scripts"],"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"}