Documentation
¶
Overview ¶
Package add provides formatted output helpers for the add command.
Index ¶
- func ErrFileNotFound(path string) error
- func ErrFileRead(path string, cause error) error
- func ErrFileWriteAdd(path string, cause error) error
- func ErrIndexUpdate(path string, cause error) error
- func ErrMissingDecision(missing []string) error
- func ErrMissingFields(entryType string, missing []string) error
- func ErrMissingLearning(missing []string) error
- func ErrNoContent() error
- func ErrNoContentProvided(fType, examples string) error
- func ErrStdinRead(cause error) error
- func ErrUnknownType(fType string) error
- func InfoAddedTo(cmd *cobra.Command, filename string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ErrFileNotFound ¶
ErrFileNotFound returns an error when a context file does not exist.
Parameters:
- path: File path that was not found
Returns:
- error: Formatted error suggesting "ctx init"
func ErrFileRead ¶
ErrFileRead wraps a file read failure with the file path.
Parameters:
- path: File path that failed to read
- cause: Underlying error from the read operation
Returns:
- error: "failed to read <path>: <cause>"
func ErrFileWriteAdd ¶
ErrFileWriteAdd wraps a file write failure with the file path.
Parameters:
- path: File path that failed to write
- cause: Underlying error from the write operation
Returns:
- error: "failed to write <path>: <cause>"
func ErrIndexUpdate ¶
ErrIndexUpdate wraps a failure to update the index in a context file.
Parameters:
- path: File path where the index update failed
- cause: Underlying error from the write operation
Returns:
- error: "failed to update index in <path>: <cause>"
func ErrMissingDecision ¶
ErrMissingDecision returns an error with usage help for incomplete decisions.
Parameters:
- missing: List of missing required flag names (e.g., "--context")
Returns:
- error: Formatted error with ADR format requirements and example
func ErrMissingFields ¶
ErrMissingFields returns a validation error for missing required fields.
Parameters:
- entryType: The entry type (e.g., "decision", "learning")
- missing: List of missing field names
Returns:
- error: Formatted error listing the missing fields
func ErrMissingLearning ¶
ErrMissingLearning returns an error with usage help for incomplete learnings.
Parameters:
- missing: List of missing required flag names (e.g., "--lesson")
Returns:
- error: Formatted error with learning format requirements and example
func ErrNoContent ¶
func ErrNoContent() error
ErrNoContent returns a simple error when no content source is available.
Returns:
- error: "no content provided"
func ErrNoContentProvided ¶
ErrNoContentProvided returns an error with usage help when content is missing.
Parameters:
- fType: Entry type (e.g., "decision", "task") for contextual examples
- examples: Type-specific example text
Returns:
- error: Formatted error showing input methods and type-specific examples
func ErrStdinRead ¶
ErrStdinRead wraps a failure to read from standard input.
Parameters:
- cause: Underlying error from the stdin read
Returns:
- error: "failed to read from stdin: <cause>"
func ErrUnknownType ¶
ErrUnknownType returns an error for an unrecognized entry type.
Parameters:
- fType: The unrecognized type string
Returns:
- error: Formatted error listing valid types
func InfoAddedTo ¶
InfoAddedTo confirms an entry was added to a context file.
Parameters:
- cmd: Cobra command for output
- filename: Name of the file the entry was added to
Types ¶
This section is empty.