Documentation
¶
Index ¶
- func ControllerFromCmd(cmd *cobra.Command) (*controller.Exec, error)
- func LoggerFromCmd(cmd *cobra.Command) (*slog.Logger, error)
- func PrintCreationOutcome(cmd *cobra.Command, label string, existsPost bool, created bool)
- func RequireNameArg(cmd *cobra.Command, args []string, resource string) (string, error)
- func RequireNameArgOrDefault(cmd *cobra.Command, args []string, resource string, fallback string) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ControllerFromCmd ¶
func ControllerFromCmd(cmd *cobra.Command) (*controller.Exec, error)
ControllerFromCmd instantiates a controller.Exec configured with the shared persistent flags (run path, containerd socket) used by the parent command.
func LoggerFromCmd ¶
LoggerFromCmd extracts the slog logger from the Cobra command context.
func PrintCreationOutcome ¶
PrintCreationOutcome prints a human-friendly status line for a created resource.
func RequireNameArg ¶
RequireNameArg ensures the first positional argument exists and returns it.
func RequireNameArgOrDefault ¶
func RequireNameArgOrDefault(cmd *cobra.Command, args []string, resource string, fallback string) (string, error)
RequireNameArgOrDefault wraps RequireNameArg but falls back to the provided default value if no positional argument is supplied or if the argument is empty/whitespace.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.