cat

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: 14 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 CatError

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

type CatResult

type CatResult struct {
	XMLName      xml.Name    `xml:"cat"`
	Path         string      `xml:"path,attr"`
	Absolute     string      `xml:"absolute,attr"`
	SizeBytes    int64       `xml:"size_bytes,attr"`
	Lines        int         `xml:"lines,attr"`
	Encoding     string      `xml:"encoding,attr"`
	Language     string      `xml:"language,attr"`
	Binary       string      `xml:"binary,attr"`
	MIME         string      `xml:"mime,attr"`
	Modified     int64       `xml:"modified,attr"`
	ModifiedAgoS int64       `xml:"modified_ago_s,attr"`
	Content      string      `xml:"content,omitempty"`
	Files        []CatResult `xml:"file,omitempty"`
	Errors       []CatError  `xml:"error,omitempty"`
}

func RunForTest

func RunForTest(path string, cfg Config) ([]CatResult, error)

type Config

type Config struct {
	LineNumbers bool `flag:"" desc:"Show line numbers"`
	XML         bool
	JSON        bool
	Plain       bool
	Pretty      bool
}

Jump to

Keyboard shortcuts

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