util

package
v3.4.9 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2024 License: MPL-2.0 Imports: 5 Imported by: 2 modules, 11 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	SpaceNameOnlyUseLine   string
	SpaceNameOnlyValidator cobra.PositionalArgs

	VClusterNameOnlyUseLine string

	VClusterNameOnlyValidator cobra.PositionalArgs
)

Functions

func GetCause

func GetCause(err error) string

func NamedPositionalArgsValidator

func NamedPositionalArgsValidator(failMissing, failExtra bool, expectedArgs ...string) (string, cobra.PositionalArgs)

NamedPositionalArgsValidator returns a cobra.PositionalArgs that returns a helpful error message if the arg number doesn't match. It also returns a string that can be appended to the cobra useline

Example output for extra arguments with :

$ command arg asdf
[fatal]  command ARG_1 [flags]
Invalid Args: received 2 arguments, expected 1, extra arguments: "asdf"
Run with --help for more details

Example output for missing arguments:

$ command
[fatal]  command ARG_1 [flags]
Invalid Args: received 0 arguments, expected 1, please specify missing: "ARG_!"
Run with --help for more details on arguments

Types

This section is empty.

Jump to

Keyboard shortcuts

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