cmdutil

package
v1.50.6 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2026 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package cmdutil provides generic cobra command utilities shared across pkg/cmd and its subpackages.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ArgsAfter added in v1.50.6

func ArgsAfter(args []string, name string) []string

ArgsAfter returns a copy of args strictly after the first occurrence of name, or an empty slice if name is absent. It is used to recover the arguments meant for a plugin binary from the raw process arguments, since Cobra consumes the tokens it recognizes before the command's RunE sees them.

func FindSubCmd

func FindSubCmd(cmd *cobra.Command, names ...string) (*cobra.Command, bool)

FindSubCmd walks cmd's subcommand tree following names in order, returning the matching command and true. Returns nil and false if any name in the path is not found.

Types

This section is empty.

Jump to

Keyboard shortcuts

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