cobrautils

package
v1.22.8 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2026 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Overview

Package cobrautils provides utility functions for Cobra command handling.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CommandSuiteUsage

func CommandSuiteUsage(cmd *cobra.Command, args []string) error

func ConfigureRootCmd

func ConfigureRootCmd(cmd *cobra.Command)

func ErrMaxArgCount

func ErrMaxArgCount(expected, got int) error

func ErrMinArgCount

func ErrMinArgCount(expected, got int) error

func ErrRangeArgCount

func ErrRangeArgCount(expectedLow, expectedHigh, got int) error

func ErrWrongArgCount

func ErrWrongArgCount(expected, got int) error

func ExactArgs

func ExactArgs(n int) cobra.PositionalArgs

func HandleErrors

func HandleErrors(err error)

func MaximumNArgs

func MaximumNArgs(n int) cobra.PositionalArgs

func MinimumNArgs

func MinimumNArgs(n int) cobra.PositionalArgs

func RangeArgs

func RangeArgs(minArgs int, maxArgs int) cobra.PositionalArgs

Types

type UsageError

type UsageError struct {
	// contains filtered or unexported fields
}

func NewUsageError

func NewUsageError(cmd *cobra.Command, err error) UsageError

func (UsageError) Error

func (e UsageError) Error() string

Jump to

Keyboard shortcuts

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