wc

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: 13 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 {
	Lines    bool `flag:"" desc:"Count lines"`
	Words    bool `flag:"" desc:"Count words"`
	Bytes    bool `flag:"" desc:"Count bytes"`
	MaxLines bool `flag:"" desc:"Show maximum line length"`
	AllFiles bool `flag:"" desc:"Count all files including hidden"`
	XML      bool
	JSON     bool
	Plain    bool
	Pretty   bool
}

type WCError

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

type WCFile

type WCFile struct {
	XMLName    xml.Name  `xml:"file"`
	Path       string    `xml:"path,attr"`
	Absolute   string    `xml:"absolute,attr"`
	Lines      int64     `xml:"lines,attr"`
	Words      int64     `xml:"words,attr"`
	Bytes      int64     `xml:"bytes,attr"`
	MaxLineLen int64     `xml:"max_line_len,attr"`
	Language   string    `xml:"language,attr"`
	Errors     []WCError `xml:"error,omitempty"`
}

type WCResult

type WCResult struct {
	XMLName    xml.Name  `xml:"wc"`
	Files      []WCFile  `xml:"file"`
	TotalLines int64     `xml:"total_lines,attr"`
	TotalWords int64     `xml:"total_words,attr"`
	TotalBytes int64     `xml:"total_bytes,attr"`
	Timestamp  int64     `xml:"timestamp,attr"`
	Errors     []WCError `xml:"error,omitempty"`
}

Jump to

Keyboard shortcuts

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