{"record":{"id":"57505af281a9d515","repo":"multica-ai/multica","slug":"invalid-direction-q-valid-values-asc-desc","errorCode":null,"errorMessage":"invalid --direction %q; valid values: asc, desc","messagePattern":"invalid --direction %q; valid values: asc, desc","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/cmd/multica/cmd_issue.go","lineNumber":656,"sourceCode":"\t}\n\tsortVal, _ := cmd.Flags().GetString(\"sort\")\n\tif sortVal != \"\" {\n\t\tvalid := false\n\t\tfor _, c := range validIssueSortColumns {\n\t\t\tif c == sortVal {\n\t\t\t\tvalid = true\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif !valid {\n\t\t\treturn fmt.Errorf(\"invalid --sort %q; valid values: %s\", sortVal, strings.Join(validIssueSortColumns, \", \"))\n\t\t}\n\t\tparams.Set(\"sort\", sortVal)\n\t}\n\tif v, _ := cmd.Flags().GetString(\"direction\"); v != \"\" {\n\t\td := strings.ToLower(v)\n\t\tif d != \"asc\" && d != \"desc\" {\n\t\t\treturn fmt.Errorf(\"invalid --direction %q; valid values: asc, desc\", v)\n\t\t}\n\t\t// position (the manual board order) is always ascending, so the server\n\t\t// ignores --direction for it. Reject the combination up front rather\n\t\t// than silently dropping the flag — a passed-but-ignored flag is a\n\t\t// footgun, especially in scripts.\n\t\tif sortVal == \"\" || sortVal == \"position\" {\n\t\t\treturn fmt.Errorf(\"--direction requires --sort to be one of %s; position (the default manual board order) is always ascending\", strings.Join(directionalIssueSortColumns, \", \"))\n\t\t}\n\t\tparams.Set(\"direction\", d)\n\t}\n\n\tpath := \"/api/issues\"\n\tif len(params) > 0 {\n\t\tpath += \"?\" + params.Encode()\n\t}\n\n\tvar result map[string]any\n\tif err := client.GetJSON(ctx, path, &result); err != nil {","sourceCodeStart":638,"sourceCodeEnd":674,"githubUrl":"https://github.com/multica-ai/multica/blob/2c0912b6ec764b373d44eeea1e80f0d9f11ab417/server/cmd/multica/cmd_issue.go#L638-L674","documentation":"The --direction flag passed to `multica issue list` is neither asc nor desc (compared case-insensitively after ToLower). This is a client-side check that runs before the sort/direction combination check, so any other value fails immediately.","triggerScenarios":"Running `multica issue list --direction ascending`, --direction DESCENDING, --direction \"asc \" (the value is lowercased but not trimmed, so stray whitespace still fails), or --direction -1.","commonSituations":"Scripts copying direction words from another tool's vocabulary (ascending/descending, 0/1); shell quoting that drags in whitespace; docs examples from a different CLI.","solutions":["Pass exactly asc or desc (any case works since it is lowercased first).","Check for invisible whitespace when the value comes from a variable: --direction \"${D// /}\".","If you only care about the default board order, drop --direction entirely."],"exampleFix":"# before\nmultica issue list --direction ascending\n# after\nmultica issue list --direction asc","handlingStrategy":"validation","validationCode":"case \"${DIRECTION,,}\" in asc|desc) ;; *) echo \"bad --direction: $DIRECTION\" >&2; exit 1;; esac","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Only asc/desc are accepted; 'ascending'/'descending'/numeric codes are not.","Trim whitespace on variable-sourced flag values."],"tags":["cli","validation","sorting","issue-list"],"backgroundTag":null,"analyzedSha":"2c0912b6ec764b373d44eeea1e80f0d9f11ab417","analyzedAt":"2026-08-15T13:25:18.241Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}