cmd

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2017 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// FILE is file.
	FILE = "file"
	// DIR is directory.
	DIR = "directory"
	// COUNT is file count.
	COUNT = "Count"
	// UTF8 is csv encoding.
	UTF8 = "utf8"
	// SJIS is csv encoding.
	SJIS = "sjis"
)
View Source
const (
	// DiffHeader is diff command output csv header.
	DiffHeader = "Path\tType\tDiff"
)

Variables

View Source
var RootCmd = &cobra.Command{Use: "gfi"}

RootCmd represents the base command when called without any subcommands

Functions

func Execute

func Execute()

Execute adds all child commands to the root command sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.

Types

type Cmd

type Cmd struct {
	File string
	Dir  string
	Name string
	Cwd  string
}

Cmd is command infomation.

type DirInfo

type DirInfo struct {
	Full      string
	Rel       string
	Abs       string
	Name      string
	Time      string
	Size      string
	FileCount int64
	DirCount  int64
}

DirInfo is file infomation.

type DirInfoValue

type DirInfoValue int

DirInfoValue is DirInfo type.

const (
	// DirFull is full path
	DirFull DirInfoValue = iota + 1
	// DirRel is relative path.
	DirRel
	// DirAbs is absolute path.
	DirAbs
	// DirName is directory name.
	DirName
	// DirTime is directory modified time.
	DirTime
	// DirSize is directory size.
	DirSize
	// DirFileCount is file count.
	DirFileCount
	// DirDirCount is directory count or directory.
	DirDirCount
	// DirMax is Max
	DirMax = iota
)

func (DirInfoValue) String

func (div DirInfoValue) String() string

type DirInfos

type DirInfos []DirInfo

DirInfos is DirInfo slice.

func (DirInfos) Len

func (d DirInfos) Len() int

Len returns DirInfos length.

func (DirInfos) Less

func (d DirInfos) Less(i, j int) bool

Less returns which DirInso is less.

func (DirInfos) Swap

func (d DirInfos) Swap(i, j int)

Swap is DirInfos swap func.

type FileInfo

type FileInfo struct {
	Full string
	Rel  string
	Abs  string
	Name string
	Time string
	Size string
	Mode string
	Type string
}

FileInfo is file infomation.

type FileInfoValue

type FileInfoValue int

FileInfoValue is FileInfo type.

const (
	// FileFull is full path
	FileFull FileInfoValue = iota + 1
	// FileRel is relative path.
	FileRel
	// FileAbs is absolute path.
	FileAbs
	// FileName is file name.
	FileName
	// FileTime is file modified time.
	FileTime
	// FileSize is file size.
	FileSize
	// FileMode is file permissions.
	FileMode
	// FileType is file or directory.
	FileType
	// FileMax is Max
	FileMax = iota
)

func (FileInfoValue) String

func (fiv FileInfoValue) String() string

type FileInfos

type FileInfos []FileInfo

FileInfos is FileInfo slice.

func (FileInfos) Len

func (f FileInfos) Len() int

Len returns FileInfos length.

func (FileInfos) Less

func (f FileInfos) Less(i, j int) bool

Less returns which FileInfo is less.

func (FileInfos) Swap

func (f FileInfos) Swap(i, j int)

Swap is FileInfos swap func.

type SizeInfo

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

SizeInfo is directory size info.

Jump to

Keyboard shortcuts

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