Documentation
¶
Overview ¶
Package cmdutil provides shared CLI helpers for epack commands.
Index ¶
- func FilterConfigCollectors(cfg *config.JobConfig, names []string) (*config.JobConfig, error)
- func FilterConfigComponents(cfg *config.JobConfig, names []string) (*config.JobConfig, error)
- func GetOutput(cmd *cobra.Command) *output.Writer
- func HandleError(err error) error
- func LoadConfig(path string) (*config.JobConfig, error)
- func LockfileNeedsUpdate(cfg *config.JobConfig, lf *lockfile.LockFile, currentPlatform string) bool
- func ParseCommaSeparated(s string) []string
- func ResolveWorkDir() (string, error)
- func ValidateCollectorNames(cfg *config.JobConfig, names []string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FilterConfigCollectors ¶
FilterConfigCollectors returns a copy of cfg with only the specified collectors. Returns an error if any collector is not found.
func FilterConfigComponents ¶
FilterConfigComponents returns a copy of cfg with only the specified components. Components can be either collectors or tools - the function figures out which. Returns an error if any component is not found.
func HandleError ¶
HandleError ensures errors have proper exit codes. If the error already has ExitCode(), it's returned as-is. Otherwise wraps it in an errors.Error with General exit code.
func LoadConfig ¶
LoadConfig loads the component configuration from the given path. Returns a wrapped error on failure with actionable hints.
func LockfileNeedsUpdate ¶
LockfileNeedsUpdate checks if the lockfile needs updating for the given config. This checks both collectors and tools.
func ParseCommaSeparated ¶
ParseCommaSeparated splits a comma-separated string into trimmed elements. Returns nil if the input is empty.
func ResolveWorkDir ¶
ResolveWorkDir returns the current working directory. Returns a wrapped error on failure.
Types ¶
This section is empty.