command

package module
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2026 License: MIT Imports: 8 Imported by: 0

README

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
)
View Source
const ErrInvalidPattern errs.Const = "invalid pattern"

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

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 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