command

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2026 License: MIT Imports: 7 Imported by: 0

README

cmd-grep

CI Go Reference

Documentation

Index

Constants

View Source
const (
	GrepIgnoreCase   grepIgnoreCaseFlag = true
	GrepNoIgnoreCase grepIgnoreCaseFlag = false
)
View Source
const (
	GrepInvert   grepInvertFlag = true
	GrepNoInvert grepInvertFlag = false
)
View Source
const (
	GrepWholeLine   grepWholeLineFlag = true
	GrepNoWholeLine grepWholeLineFlag = false
)
View Source
const (
	GrepExtended   grepExtendedFlag = true
	GrepNoExtended grepExtendedFlag = false
)
View Source
const (
	GrepWord   grepWordFlag = true
	GrepNoWord grepWordFlag = false
)
View Source
const (
	GrepLineNumbers   grepLineNumbersFlag = true
	GrepNoLineNumbers grepLineNumbersFlag = false
)
View Source
const (
	GrepCount   grepCountFlag = true
	GrepNoCount grepCountFlag = false
)

Variables

This section is empty.

Functions

func Grep

func Grep(pattern GrepPattern, opts ...any) gloo.Command[[]byte, []byte]

Grep returns a Command that filters lines matching pattern. pattern is a required positional argument; the remaining options select the match mode.

Flags:

  • GrepIgnoreCase (-i): case-insensitive matching
  • GrepInvert (-v): emit non-matching lines
  • GrepWholeLine (-x): match only when the whole line equals the pattern
  • GrepExtended (-E): interpret the pattern as an extended regular expression
  • GrepWord (-w): match only at word boundaries
  • GrepLineNumbers (-n): prefix each emitted line with its line number
  • GrepCount (-c): emit the count of matching lines instead of the lines

Types

type Error

type Error string

Error is the sole error type the package emits, enabling errors.Is checks.

const ErrInvalidPattern Error = "invalid pattern"

ErrInvalidPattern wraps a regular expression that fails to compile (-E/-w).

func (Error) Error

func (e Error) Error() string

type GrepPattern

type GrepPattern string

GrepPattern is the pattern grep matches each line against: a literal substring by default, or a regular expression under -E/-w.

Directories

Path Synopsis
Package alias provides short names for grep command flags.
Package alias provides short names for grep command flags.

Jump to

Keyboard shortcuts

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