{"record":{"id":"6429ff55fed51fbf","repo":"gastownhall/beads","slug":"no-s-provided-s","errorCode":null,"errorMessage":"no %s provided (%s)","messagePattern":"no (.+?) provided \\((.+?)\\)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/bd/flags.go","lineNumber":329,"sourceCode":"}\n\n// requireTextFromSources resolves body text like textFromSources and owns the\n// shared empty-text policy: text from an explicit source must be non-blank\n// (\"<noun> cannot be empty\"), and with no source at all the error lists the\n// command's accepted sources via hint (e.g. \"use positional args, --stdin, or\n// --file\").\nfunc requireTextFromSources(noun, hint string, src textSources) (string, error) {\n\ttext, provided, err := textFromSources(src)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tif strings.TrimSpace(text) != \"\" {\n\t\treturn text, nil\n\t}\n\tif provided {\n\t\treturn \"\", fmt.Errorf(\"%s cannot be empty\", noun)\n\t}\n\treturn \"\", fmt.Errorf(\"no %s provided (%s)\", noun, hint)\n}\n\n// registerPriorityFlag registers the priority flag with a specific default value.\nfunc registerPriorityFlag(cmd *cobra.Command, defaultVal string) {\n\tcmd.Flags().StringP(\"priority\", \"p\", defaultVal, \"Priority (0-4 or P0-P4, 0=highest)\")\n}\n","sourceCodeStart":311,"sourceCodeEnd":336,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/cmd/bd/flags.go#L311-L336","documentation":"requireTextFromSources in cmd/bd/flags.go returns this error when no text source was provided at all (provided == false) for a required text argument. The message includes the noun (e.g. 'description', 'title') and a hint explaining how to supply the text, such as via positional argument, --stdin, or --file.","triggerScenarios":"Invoking a command that requires text without any of: positional text argument, --stdin flag, or --file flag, e.g. `bd create` with no description argument or input flag.","commonSituations":"Forgetting the positional description in scripts; calling the command interactively expecting a prompt that does not exist; wrappers stripping empty arguments so the positional arg disappears; shell variables expanding to nothing.","solutions":["Pass the text as a positional argument: bd create \"title\" \"description\".","Pipe the text: echo \"description\" | bd create --stdin.","Pass a file: bd create --file desc.txt.","Quote shell variables (\"$DESC\") and verify they are non-empty before invocation."],"exampleFix":"// before\nbd create \"my title\"          # missing description\n// after\nbd create \"my title\" \"description text\"","handlingStrategy":"validation","validationCode":"// shell: require a text argument\nif [ $# -lt 1 ] || [ -z \"$1\" ]; then\n  echo \"usage: bd create <title> <description>\" >&2; exit 1\nfi","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always pass the positional text or an explicit --stdin/--file flag.","Quote variables (\"$ARG\") so empty values are not silently dropped by the shell.","Read command help to learn which noun is required (title, description).","In wrappers, assert required args before exec'ing bd."],"tags":["cli","validation","missing-argument"],"backgroundTag":"missing-required-argument","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}