cmdutil

package
v0.24.0 Latest Latest
Warning

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

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

Documentation

Overview

Package cmdutil provides utility functions and argument validators to facilitate the creation and validation of CLI command arguments when using the spf13/cobra library.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExpandGlobPatternsFromArgs

func ExpandGlobPatternsFromArgs(args []string) ([]string, error)

ExpandGlobPatternsFromArgs expands each argument in args as a glob pattern, returning a slice containing all matching file paths. If any pattern is invalid, an error is returned. Patterns that do not match any files are silently ignored.

func RegularFiles

func RegularFiles(_ *cobra.Command, args []string) error

RegularFiles validates that each arg is a regular file.

func ValidateArgs

func ValidateArgs(validators ...cobra.PositionalArgs) cobra.PositionalArgs

ValidateArgs combines PositionalArgs validators and runs them serially.

Types

This section is empty.

Jump to

Keyboard shortcuts

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