pat

package
v0.0.0-...-00c24fd Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Pattern

type Pattern struct {
	Cmd  string
	Args []string
}

Pattern is a simple pattern mather that matches a command based on a command name and it's arguments

func All

func All() *Pattern

All creates a new Pattern matcher that matches all commands

func New

func New(cmd string, args ...string) *Pattern

New creates a new Pattern matcher a cmd of "*" will match all commands

func (*Pattern) Match

func (p *Pattern) Match(cmd *puffin.FuncCmd) bool

Match matches a FuncCmd if it has a matching command name and matching arguments. The order of the arguments is not taken into account when matching

Jump to

Keyboard shortcuts

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