cut

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(args []string) error

Types

type Config

type Config struct {
	Fields     string `flag:"" desc:"Select fields (e.g., 1,3-5)"`
	Delimiter  string `flag:"" desc:"Field delimiter (default: tab)"`
	Characters string `flag:"" desc:"Select characters (e.g., 1-10)"`
	OnlyDelim  bool   `flag:"" desc:"Only print lines with delimiter"`
	XML        bool
	JSON       bool
	Plain      bool
	Pretty     bool
}

type CutError

type CutError struct {
	XMLName xml.Name `xml:"error"`
	Code    int      `xml:"code,attr"`
	Msg     string   `xml:"msg,attr"`
}

type CutResult

type CutResult struct {
	XMLName        xml.Name   `xml:"cut"`
	Timestamp      int64      `xml:"timestamp,attr"`
	Delimiter      string     `xml:"delimiter,attr"`
	Fields         string     `xml:"fields,attr"`
	LinesProcessed int        `xml:"lines_processed,attr"`
	Content        string     `xml:"content,omitempty"`
	Errors         []CutError `xml:"error,omitempty"`
}

Jump to

Keyboard shortcuts

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