ls

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: 16 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 {
	All       bool `flag:"" desc:"Show hidden files (starting with .)"`
	AlmostAll bool `flag:"" desc:"Show almost all (exclude . and ..)"`
	SortTime  bool `flag:"" desc:"Sort by modification time, newest first"`
	Reverse   bool `flag:"" desc:"Reverse sort order"`
	Recursive bool `flag:"" desc:"List subdirectories recursively"`
	XML       bool
	JSON      bool
	Plain     bool
	Pretty    bool
	Compact   bool
}

type DirEntry

type DirEntry struct {
	XMLName      xml.Name `xml:"directory"`
	Name         string   `xml:"name,attr"`
	Path         string   `xml:"path,attr"`
	Modified     int64    `xml:"modified,attr"`
	ModifiedAgoS int64    `xml:"modified_ago_s,attr"`
	Permissions  string   `xml:"permissions,attr"`
	Mode         string   `xml:"mode,attr"`
	Owner        string   `xml:"owner,attr"`
	Group        string   `xml:"group,attr"`
}

type FileEntry

type FileEntry struct {
	XMLName      xml.Name `xml:"file"`
	Name         string   `xml:"name,attr"`
	Path         string   `xml:"path,attr"`
	Absolute     string   `xml:"absolute,attr"`
	SizeBytes    uint64   `xml:"size_bytes,attr"`
	SizeHuman    string   `xml:"size_human,attr"`
	Modified     int64    `xml:"modified,attr"`
	ModifiedAgoS int64    `xml:"modified_ago_s,attr"`
	Permissions  string   `xml:"permissions,attr"`
	Mode         string   `xml:"mode,attr"`
	Owner        string   `xml:"owner,attr"`
	Group        string   `xml:"group,attr"`
	Executable   string   `xml:"executable,attr"`
	Symlink      string   `xml:"symlink,attr"`
	MIME         string   `xml:"mime,attr"`
	Language     string   `xml:"language,attr"`
	Binary       string   `xml:"binary,attr"`
}

type LSError

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

type LSItem

type LSItem interface {
	// contains filtered or unexported methods
}

type LSResult

type LSResult struct {
	XMLName      xml.Name      `xml:"ls"`
	Path         string        `xml:"path,attr"`
	Absolute     string        `xml:"absolute,attr"`
	TotalEntries int           `xml:"total_entries,attr"`
	Hidden       bool          `xml:"hidden,attr"`
	Recursive    bool          `xml:"recursive,attr"`
	Timestamp    int64         `xml:"timestamp,attr"`
	Entries      []interface{} `xml:",any"`
	Errors       []LSError     `xml:"error,omitempty"`
}

type SymlinkEntry

type SymlinkEntry struct {
	XMLName        xml.Name `xml:"symlink"`
	Name           string   `xml:"name,attr"`
	Path           string   `xml:"path,attr"`
	Target         string   `xml:"target,attr"`
	TargetAbsolute string   `xml:"target_absolute,attr"`
	TargetExists   string   `xml:"target_exists,attr"`
	Modified       int64    `xml:"modified,attr"`
	ModifiedAgoS   int64    `xml:"modified_ago_s,attr"`
	Permissions    string   `xml:"permissions,attr"`
	Mode           string   `xml:"mode,attr"`
}

Jump to

Keyboard shortcuts

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