Documentation
¶
Index ¶
- Constants
- Variables
- func NewATimeGetter(colors bool, params *TimeParams) table.Getter
- func NewCTimeGetter(colors bool, params *TimeParams) table.Getter
- func NewFileNameGetter(colors bool, params *FileNameParams) table.Getter
- func NewGroupGetter(colors bool) table.Getter
- func NewMTimeGetter(colors bool, params *TimeParams) table.Getter
- func NewModeGetter(colors bool) table.Getter
- func NewOctalModeGetter(colors bool) table.Getter
- func NewOwnerGetter(colors bool) table.Getter
- func NewSizeGetter(colors bool, format SizeFormat) table.Getter
- func Run(rawArgs []string)
- func Strftime(tm *time.Time, fmt string) string
- type ATimeGetter
- type ATimeGetterPlain
- type Application
- func (app *Application) AddError(err error)
- func (app *Application) Exit()
- func (app *Application) ListDir(tableObj *table.Table, path string)
- func (app *Application) ListDirList(tableSpec *table.TableSpec, pathList []string)
- func (app *Application) ListFiles(tableObj *table.Table, parentDir string, infoList []*FileInfo, ...)
- func (app *Application) PostParse(args *lsargs.Arguments) *table.TableSpec
- func (app *Application) PrintErrors()
- func (app *Application) WorkDir() string
- type BlocksGetter
- type ByDirContentsCount
- type ByExtension
- type ByFileSize
- type ByHardLinks
- type ByInode
- type ByKind
- type ByNameLength
- type BySize
- type ByTime
- type CTimeGetter
- type CTimeGetterPlain
- type DefaultSorter
- type DisplayItem
- type DisplayItemList
- type ExprGetter
- func (f *ExprGetter) Alignment() (table.Alignment, error)
- func (f *ExprGetter) Format(item any, value any) (string, error)
- func (f *ExprGetter) MustValueBool(info *FileInfo) bool
- func (f *ExprGetter) Type() (reflect.Type, error)
- func (f *ExprGetter) Value(item any) (any, error)
- func (f *ExprGetter) ValueBool(info *FileInfo) (bool, error)
- func (f *ExprGetter) ValueString(colName string, item any) (string, error)
- type FileInfo
- type FileInfoLow
- type FileNameGetter
- type FileNameGetterPlain
- type FileNameParams
- type GroupGetter
- type GroupGetterPlain
- type HardLinksGetter
- type InodeGetter
- type ItemSorter
- type LinkInfo
- type MTimeGetter
- type MTimeGetterPlain
- type ModeGetter
- type ModeGetterPlain
- type OctModeGetter
- type OwnerGetter
- type OwnerGetterPlain
- type SizeGetter
- type SizeGetterPlain
- type TimeGetter
- type TimeGetterPlain
Constants ¶
View Source
const Reset = "\x1b[0m"
Reset undoes ANSI color codes
View Source
const VERSION = "1.1.0"
Variables ¶
View Source
var FileAliases = map[string]string{}/* 158 elements not displayed */
Functions ¶
func NewATimeGetter ¶
func NewATimeGetter(colors bool, params *TimeParams) table.Getter
func NewCTimeGetter ¶
func NewCTimeGetter(colors bool, params *TimeParams) table.Getter
func NewFileNameGetter ¶
func NewFileNameGetter(colors bool, params *FileNameParams) table.Getter
func NewGroupGetter ¶
func NewGroupGetter(colors bool) table.Getter
func NewMTimeGetter ¶
func NewMTimeGetter(colors bool, params *TimeParams) table.Getter
func NewModeGetter ¶
func NewModeGetter(colors bool) table.Getter
func NewOctalModeGetter ¶
func NewOctalModeGetter(colors bool) table.Getter
func NewOwnerGetter ¶
func NewOwnerGetter(colors bool) table.Getter
func NewSizeGetter ¶
func NewSizeGetter(colors bool, format SizeFormat) table.Getter
Types ¶
type ATimeGetter ¶
type ATimeGetter struct {
*TimeGetter
}
func (*ATimeGetter) ValueString ¶
func (f *ATimeGetter) ValueString(colName string, item any) (string, error)
type ATimeGetterPlain ¶
type ATimeGetterPlain struct {
*TimeGetterPlain
}
func (*ATimeGetterPlain) ValueString ¶
func (f *ATimeGetterPlain) ValueString(colName string, item any) (string, error)
type Application ¶
type Application struct { iface.FileSystem iface.Terminal iface.Formatter Platform *lsplatform.LocalPlatform PrimaryTimeColName string QuotingStyle string // contains filtered or unexported fields }
func NewApplication ¶
func NewApplication() *Application
func (*Application) AddError ¶
func (app *Application) AddError(err error)
func (*Application) Exit ¶
func (app *Application) Exit()
func (*Application) ListDir ¶
func (app *Application) ListDir(tableObj *table.Table, path string)
func (*Application) ListDirList ¶
func (app *Application) ListDirList(tableSpec *table.TableSpec, pathList []string)
func (*Application) ListFiles ¶
func (app *Application) ListFiles(tableObj *table.Table, parentDir string, infoList []*FileInfo, forceDotfiles bool)
func (*Application) PostParse ¶
func (app *Application) PostParse(args *lsargs.Arguments) *table.TableSpec
func (*Application) PrintErrors ¶
func (app *Application) PrintErrors()
func (*Application) WorkDir ¶
func (app *Application) WorkDir() string
type BlocksGetter ¶
type BlocksGetter struct{}
func (*BlocksGetter) ValueString ¶
func (f *BlocksGetter) ValueString(colName string, item any) (string, error)
type ByDirContentsCount ¶
type ByDirContentsCount ItemSorter
sorts by the number of contents (files and directories) in directories directories always come before files and remember, this includes hidden contents as well, so to count manually, use `ls -A1` or `ls-go -a1`
func (ByDirContentsCount) Len ¶
func (s ByDirContentsCount) Len() int
func (ByDirContentsCount) Less ¶
func (s ByDirContentsCount) Less(i, j int) bool
func (ByDirContentsCount) Swap ¶
func (s ByDirContentsCount) Swap(i, j int)
type ByExtension ¶
type ByExtension ItemSorter
func (ByExtension) Len ¶
func (s ByExtension) Len() int
func (ByExtension) Less ¶
func (s ByExtension) Less(i, j int) bool
func (ByExtension) Swap ¶
func (s ByExtension) Swap(i, j int)
type ByFileSize ¶
type ByFileSize ItemSorter
ByFileSize sorts files by size, and directories by lowercased name and sort directories after files
func (ByFileSize) Len ¶
func (s ByFileSize) Len() int
func (ByFileSize) Less ¶
func (s ByFileSize) Less(i, j int) bool
func (ByFileSize) Swap ¶
func (s ByFileSize) Swap(i, j int)
type ByHardLinks ¶
type ByHardLinks ItemSorter
func (ByHardLinks) Len ¶
func (s ByHardLinks) Len() int
func (ByHardLinks) Less ¶
func (s ByHardLinks) Less(i, j int) bool
func (ByHardLinks) Swap ¶
func (s ByHardLinks) Swap(i, j int)
type ByInode ¶
type ByInode ItemSorter
type ByNameLength ¶
type ByNameLength ItemSorter
func (ByNameLength) Len ¶
func (s ByNameLength) Len() int
func (ByNameLength) Less ¶
func (s ByNameLength) Less(i, j int) bool
func (ByNameLength) Swap ¶
func (s ByNameLength) Swap(i, j int)
type ByTime ¶
type ByTime ItemSorter
sort by time (modified time by default) in decending order (newer first)
type CTimeGetter ¶
type CTimeGetter struct {
*TimeGetter
}
func (*CTimeGetter) ValueString ¶
func (f *CTimeGetter) ValueString(colName string, item any) (string, error)
type CTimeGetterPlain ¶
type CTimeGetterPlain struct {
*TimeGetterPlain
}
func (*CTimeGetterPlain) ValueString ¶
func (f *CTimeGetterPlain) ValueString(colName string, item any) (string, error)
type DefaultSorter ¶
type DefaultSorter ItemSorter
DefaultSorter is the default sorter for files and directories it first sorts by lowercased basename, then by extension
func (DefaultSorter) Len ¶
func (s DefaultSorter) Len() int
func (DefaultSorter) Less ¶
func (s DefaultSorter) Less(i, j int) bool
func (DefaultSorter) Swap ¶
func (s DefaultSorter) Swap(i, j int)
type DisplayItem ¶
DisplayItem wraps the file stat info and string to be printed
type DisplayItemList ¶
type DisplayItemList []*DisplayItem
func (DisplayItemList) Get ¶
func (list DisplayItemList) Get(index int) []string
func (DisplayItemList) Len ¶
func (list DisplayItemList) Len() int
type ExprGetter ¶
type ExprGetter struct {
// contains filtered or unexported fields
}
func NewExprGetter ¶
func NewExprGetter(colors bool, exprStr string) *ExprGetter
func (*ExprGetter) Alignment ¶
func (f *ExprGetter) Alignment() (table.Alignment, error)
func (*ExprGetter) MustValueBool ¶
func (f *ExprGetter) MustValueBool(info *FileInfo) bool
func (*ExprGetter) ValueString ¶
func (f *ExprGetter) ValueString(colName string, item any) (string, error)
type FileInfo ¶
type FileInfo struct { fs.FileInfo Basename string Ext string Suffix string Dir string CurDir string IsAbs bool // contains filtered or unexported fields }
func (*FileInfo) PathDisplay ¶
type FileInfoLow ¶
type FileInfoLow struct {
// contains filtered or unexported fields
}
func NewFileInfoLowFrom ¶
func NewFileInfoLowFrom(fi fs.FileInfo) *FileInfoLow
func (*FileInfoLow) IsDir ¶
func (fi *FileInfoLow) IsDir() bool
func (*FileInfoLow) ModTime ¶
func (fi *FileInfoLow) ModTime() time.Time
func (*FileInfoLow) Mode ¶
func (fi *FileInfoLow) Mode() fs.FileMode
func (*FileInfoLow) Name ¶
func (fi *FileInfoLow) Name() string
func (*FileInfoLow) Size ¶
func (fi *FileInfoLow) Size() int64
func (*FileInfoLow) Sys ¶
func (fi *FileInfoLow) Sys() any
type FileNameGetter ¶
type FileNameGetter struct {
*FileNameParams
}
func (*FileNameGetter) Format ¶
func (f *FileNameGetter) Format(item any, value any) (string, error)
func (*FileNameGetter) ValueString ¶
func (f *FileNameGetter) ValueString(colName string, item any) (string, error)
type FileNameGetterPlain ¶
type FileNameGetterPlain struct {
*FileNameParams
}
func (*FileNameGetterPlain) Format ¶
func (f *FileNameGetterPlain) Format(item any, value any) (string, error)
func (*FileNameGetterPlain) ValueString ¶
func (f *FileNameGetterPlain) ValueString(colName string, item any) (string, error)
type FileNameParams ¶
type FileNameParams struct {
// contains filtered or unexported fields
}
type GroupGetter ¶
type GroupGetter struct{}
func (*GroupGetter) ValueString ¶
func (f *GroupGetter) ValueString(colName string, item any) (string, error)
type GroupGetterPlain ¶
type GroupGetterPlain struct{}
func (*GroupGetterPlain) Format ¶
func (f *GroupGetterPlain) Format(item any, value any) (string, error)
func (*GroupGetterPlain) ValueString ¶
func (f *GroupGetterPlain) ValueString(colName string, item any) (string, error)
type HardLinksGetter ¶
type HardLinksGetter struct{}
func (*HardLinksGetter) Format ¶
func (f *HardLinksGetter) Format(item any, value any) (string, error)
func (*HardLinksGetter) ValueString ¶
func (f *HardLinksGetter) ValueString(colName string, item any) (string, error)
type InodeGetter ¶
type InodeGetter struct{}
func (*InodeGetter) ValueString ¶
func (f *InodeGetter) ValueString(colName string, item any) (string, error)
type ItemSorter ¶
type ItemSorter []*DisplayItem
type LinkInfo ¶
type LinkInfo struct {
// contains filtered or unexported fields
}
LinkInfo wraps link stat info and whether the link points to valid file
func (*LinkInfo) Dereference ¶
type MTimeGetter ¶
type MTimeGetter struct {
*TimeGetter
}
func (*MTimeGetter) ValueString ¶
func (f *MTimeGetter) ValueString(colName string, item any) (string, error)
type MTimeGetterPlain ¶
type MTimeGetterPlain struct {
*TimeGetterPlain
}
func (*MTimeGetterPlain) ValueString ¶
func (f *MTimeGetterPlain) ValueString(colName string, item any) (string, error)
type ModeGetter ¶
type ModeGetter struct{}
func (*ModeGetter) ValueString ¶
func (f *ModeGetter) ValueString(colName string, item any) (string, error)
type ModeGetterPlain ¶
type ModeGetterPlain struct{}
func (*ModeGetterPlain) Format ¶
func (f *ModeGetterPlain) Format(item any, value any) (string, error)
func (*ModeGetterPlain) ValueString ¶
func (f *ModeGetterPlain) ValueString(colName string, item any) (string, error)
type OctModeGetter ¶
type OctModeGetter struct{}
func (*OctModeGetter) ValueString ¶
func (f *OctModeGetter) ValueString(colName string, item any) (string, error)
type OwnerGetter ¶
type OwnerGetter struct{}
func (*OwnerGetter) ValueString ¶
func (f *OwnerGetter) ValueString(colName string, item any) (string, error)
type OwnerGetterPlain ¶
type OwnerGetterPlain struct{}
func (*OwnerGetterPlain) Format ¶
func (f *OwnerGetterPlain) Format(item any, value any) (string, error)
func (*OwnerGetterPlain) ValueString ¶
func (f *OwnerGetterPlain) ValueString(colName string, item any) (string, error)
type SizeGetter ¶
type SizeGetter struct {
// contains filtered or unexported fields
}
func (*SizeGetter) ValueString ¶
func (f *SizeGetter) ValueString(colName string, item any) (string, error)
type SizeGetterPlain ¶
type SizeGetterPlain struct {
// contains filtered or unexported fields
}
func (*SizeGetterPlain) Format ¶
func (f *SizeGetterPlain) Format(item any, value any) (string, error)
func (*SizeGetterPlain) ValueString ¶
func (f *SizeGetterPlain) ValueString(colName string, item any) (string, error)
type TimeGetter ¶
type TimeGetter struct {
*TimeParams
}
type TimeGetterPlain ¶
type TimeGetterPlain struct {
*TimeParams
}
Source Files
¶
- app.go
- app_colors.go
- app_main.go
- blocks.go
- columns.go
- expr.go
- file-icons.go
- fileinfo.go
- filename.go
- filename_noc.go
- group.go
- group_noc.go
- hard_links.go
- inode.go
- item.go
- link.go
- list.go
- mode.go
- mode_funcs.go
- mode_noc.go
- mode_oct.go
- owner.go
- owner_noc.go
- quote.go
- size.go
- size_noc.go
- sort.go
- sort_files.go
- stat.go
- strftime.go
- time.go
- time_noc.go
- utils.go
Click to show internal directories.
Click to hide internal directories.