middleware

package
v2.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NoArgs cli.BeforeFunc = func(ctx *cli.Context) error {

	if ctx.NArg() > 0 && ctx.App.Command(ctx.Args()[0]) == nil {
		cmdName := ctx.Command.Name
		if cmdName == "" && ctx.App.Name != "" {
			cmdName = ctx.App.Name
		}

		return fmt.Errorf("unknown command %q for %q", ctx.Args()[0], cmdName)
	}
	return nil
}

Functions

func WithBeforeFns

func WithBeforeFns(fns ...cli.BeforeFunc) cli.BeforeFunc

WithBeforeFns returns a cli.BeforeFunc that calls each of the provided functions in order. NOTE: The first function to return an error will end execution and be returned as the error value of the composed function.

Types

This section is empty.

Jump to

Keyboard shortcuts

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