cmd

package
v0.0.0-...-75b2c61 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2016 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultColors     = "exfxcxdxbxegedabagacad"
	TestOtherWritable = 02
	TestExecutable    = 0111
)

Variables

View Source
var AllCommands = []string{
	"ls",
}
View Source
var BgColorMapping = map[rune][]color.Attribute{
	'a': {color.BgBlack},
	'b': {color.BgRed},
	'c': {color.BgGreen},
	'd': {color.BgYellow},
	'e': {color.BgBlue},
	'f': {color.BgMagenta},
	'g': {color.BgCyan},
	'h': {color.BgWhite},
	'A': {color.BgHiWhite},
	'B': {color.Bold, color.BgRed},
	'C': {color.Bold, color.BgGreen},
	'D': {color.Bold, color.BgYellow},
	'E': {color.Bold, color.BgBlue},
	'F': {color.Bold, color.BgMagenta},
	'G': {color.Bold, color.BgCyan},
	'H': {color.Bold, color.BgWhite},
	'x': {},
}
View Source
var Colorize bool // FIXME: should not use a global variable here.
View Source
var FgColorMapping = map[rune][]color.Attribute{
	'a': {color.FgBlack},
	'b': {color.FgRed},
	'c': {color.FgGreen},
	'd': {color.FgYellow},
	'e': {color.FgBlue},
	'f': {color.FgMagenta},
	'g': {color.FgCyan},
	'h': {color.FgWhite},
	'A': {color.FgHiWhite},
	'B': {color.Bold, color.FgRed},
	'C': {color.Bold, color.FgGreen},
	'D': {color.Bold, color.FgYellow},
	'E': {color.Bold, color.FgBlue},
	'F': {color.Bold, color.FgMagenta},
	'G': {color.Bold, color.FgCyan},
	'H': {color.Bold, color.FgWhite},
	'x': {},
}
View Source
var LSColors []rune

Functions

func ExitError

func ExitError(err error)

Types

type DirEntry

type DirEntry struct {
	// contains filtered or unexported fields
}

DirEntry is dirent(5). If the positional arguments contains non-directory files, all of them will be considered under a virtual directory of name "" so the logic can be unified.

func (DirEntry) String

func (de DirEntry) String() string

type Entry

type Entry struct {
	// contains filtered or unexported fields
}

Entry represent a single file. It wraps os.File and os.FileInfo together.

func (Entry) String

func (entry Entry) String() string

type EntrySlice

type EntrySlice []Entry

EntrySlice represent a list of files.

func (EntrySlice) String

func (es EntrySlice) String() string

type ExitMessage

type ExitMessage struct {
	Message string
}

func (ExitMessage) Error

func (e ExitMessage) Error() string

type Koreutils

type Koreutils struct {
	ProgName  string
	HelpFlag  bool `flag:"h,help" description:"Show this help message"`
	DoInstall bool `flag:"install" description:"Install commands by create symlinks"`
	List      List `command:"ls" alias:"list" description:"List directory content"`
}

func (*Koreutils) Install

func (k *Koreutils) Install(dir string) error

func (*Koreutils) Run

func (k *Koreutils) Run(p writ.Path, args []string)

type List

type List struct {
	HelpFlag    bool `flag:"h,help" description:"Show this help message"`
	Colorize    bool `flag:"G" description:"Enable colorize output"`
	ShowDotFile bool `flag:"a" descrition:"Include dot files (file name starts with a .)"`
}

func (*List) Run

func (ls *List) Run(p writ.Path, args []string)

Jump to

Keyboard shortcuts

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