package appargs
import "github.com/Microsoft/hcsshim/internal/appargs"
Package appargs provides argument validation routines for use with github.com/urfave/cli.
Index ¶
- Variables
- func NonEmptyString(args []string) int
- func String(args []string) int
- func Validate(vs ...Validator) cli.BeforeFunc
- type Validator
Variables ¶
ErrInvalidUsage is returned when there is a validation error.
Functions ¶
func NonEmptyString ¶
NonEmptyString is a validator for non-empty strings.
func String ¶
String is a validator for strings.
func Validate ¶
func Validate(vs ...Validator) cli.BeforeFunc
Validate can be used as a command's Before function to validate the arguments to the command.
Types ¶
type Validator ¶
Validator is an argument validator function. It returns the number of arguments consumed or -1 on error.
func Int ¶
Int returns a validator for integers.
func Optional ¶
Optional returns a validator that treats an argument as optional.
func Rest ¶
Rest returns a validator that validates each of the remaining arguments.
Source Files ¶
- Version
- v0.12.9 (latest)
- Published
- Oct 30, 2024
- Platform
- linux/amd64
- Imports
- 3 packages
- Last checked
- 14 hours ago –
Tools for package owners.