sort

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2026 License: MIT Imports: 11 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 {
	Numeric    bool   `flag:"" desc:"Sort numerically"`
	Reverse    bool   `flag:"" desc:"Sort in reverse order"`
	Key        int    `flag:"" desc:"Sort by field number (1-based)"`
	Delimiter  string `flag:"" desc:"Field delimiter (default: tab)"`
	OutputFile string `flag:"" desc:"Write output to file"`
	Unique     bool   `flag:"" desc:"Remove duplicate lines"`
	XML        bool
	JSON       bool
	Plain      bool
	Pretty     bool
}

type SortError

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

type SortResult

type SortResult struct {
	XMLName   xml.Name    `xml:"sort"`
	Timestamp int64       `xml:"timestamp,attr"`
	LinesIn   int         `xml:"lines_in,attr"`
	LinesOut  int         `xml:"lines_out,attr"`
	KeyField  int         `xml:"key,attr"`
	Order     string      `xml:"order,attr"`
	Content   string      `xml:"content,omitempty"`
	Errors    []SortError `xml:"error,omitempty"`
}

Jump to

Keyboard shortcuts

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