command

package module
v0.1.4 Latest Latest
Warning

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

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

README

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Nl

func Nl(opts ...any) gloo.Command[[]byte, []byte]

Nl numbers lines from stdin.

Flags:

  • NlBodyAll, NlBodyNonEmpty, NlBodyNone (-b): which lines to number (default: all)
  • NlSep(s) (-s): separator between number and line (default: "\t")
  • NlStart(n) (-v): starting line number (default: 1)
  • NlIncrement(n) (-i): line number increment (default: 1)
  • NlWidth(n) (-w): field width for line numbers (default: 6)
  • NlFormat(f) / NlFormatLN / NlFormatRN / NlFormatRZ (-n): number format (default: rn)

Types

type NlBody

type NlBody string

NlBody selects which lines are numbered. Maps to the -b flag: "a" (all, default), "t" (non-empty only), "n" (none).

const (
	NlBodyAll      NlBody = "a"
	NlBodyNonEmpty NlBody = "t"
	NlBodyNone     NlBody = "n"
)

type NlFormat

type NlFormat string

NlFormat sets the line-number format (-n flag). Valid values: "ln" (left justified), "rn" (right justified, default), "rz" (right justified zero-padded).

const (
	NlFormatLN NlFormat = "ln"
	NlFormatRN NlFormat = "rn"
	NlFormatRZ NlFormat = "rz"
)

type NlIncrement

type NlIncrement int

NlIncrement sets the line-number increment (-i flag, default 1).

type NlSep

type NlSep string

NlSep sets the separator between the line number and the line text. Maps to the -s flag. Default is "\t".

type NlStart

type NlStart int

NlStart sets the starting line number (-v flag, default 1).

type NlWidth

type NlWidth int

NlWidth sets the field width for line numbers (-w flag, default 6).

Directories

Path Synopsis
Package alias provides unprefixed names for nl command flags.
Package alias provides unprefixed names for nl command flags.

Jump to

Keyboard shortcuts

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