add

package
v0.8.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 24, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package add provides formatted output helpers for the add command.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrFileNotFound

func ErrFileNotFound(path string) error

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

func ErrFileRead(path string, cause error) error

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

func ErrFileWriteAdd(path string, cause error) error

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

func ErrIndexUpdate(path string, cause error) error

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

func ErrMissingDecision(missing []string) error

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

func ErrMissingFields(entryType string, missing []string) error

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

func ErrMissingLearning(missing []string) error

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

func ErrNoContentProvided(fType, examples string) error

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

func ErrStdinRead(cause error) error

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

func ErrUnknownType(fType string) error

ErrUnknownType returns an error for an unrecognized entry type.

Parameters:

  • fType: The unrecognized type string

Returns:

  • error: Formatted error listing valid types

func InfoAddedTo

func InfoAddedTo(cmd *cobra.Command, filename string)

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL