some

package
v0.0.0-...-ea96358 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2023 License: BSD-3-Clause Imports: 22 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Basename

func Basename(args ...string) someutils.CliPipable

Factory for *SomeBasename

func BasenameCli

func BasenameCli(call []string) (error, int)

CLI invocation for *SomeBasename

func Cat

func Cat(fileNames ...string) someutils.CliPipable

func CatCli

func CatCli(call []string) (error, int)

func CpCli

func CpCli(call []string) (error, int)

CLI invocation for *SomeCp

func DirnameCli

func DirnameCli(call []string) (error, int)

CLI invocation for *SomeDirname

func Exec

func Exec(args ...string) someutils.Pipable

Factory for *SomeExec

func Grep

func Grep(args ...string) someutils.CliPipable

Factory for *SomeGrep

func GrepCli

func GrepCli(call []string) (error, int)

CLI invocation for *SomeGrep

func Gunzip

func Gunzip(args ...string) someutils.CliPipable

Factory for *SomeGunzip

func GunzipCli

func GunzipCli(call []string) (error, int)

CLI invocation for *SomeGunzip

func GunzipToOut

func GunzipToOut(args ...string) someutils.CliPipable

func Gzip

func Gzip(args ...string) someutils.CliPipable

Factory for *SomeGzip

func GzipCli

func GzipCli(call []string) (error, int)

CLI invocation for *SomeGzip

func GzipTo

func GzipTo(outFile string) someutils.CliPipable

Factory for *SomeGzip

func Head(lines int, args ...string) someutils.CliPipable

Factory for *SomeHead

func HeadCli

func HeadCli(call []string) (error, int)

CLI invocation for *SomeHead

func Init

func Init()

no-op. For implicitly invoking init() on all files in this package.

func Ls

func Ls(args ...string) someutils.CliPipable

Factory for *SomeLs

func LsCli

func LsCli(call []string) (error, int)

CLI invocation for *SomeLs

func LsFact

func LsFact() someutils.CliPipable

func MvCli

func MvCli(call []string) (error, int)

CLI invocation for *SomeMv

func PwdCli

func PwdCli(call []string) (error, int)

CLI invocation for *SomePwd

func RmCli

func RmCli(call []string) (error, int)

CLI invocation for *SomeRm

func SleepCli

func SleepCli(call []string) (error, int)

CLI invocation for *SomeSleep

func TailCli

func TailCli(call []string) (error, int)

CLI invocation for *SomeTail

func TarCli

func TarCli(call []string) (error, int)

CLI invocation for *SomeTar

func TarItems

func TarItems(tarfile string, includeFiles []string, t *SomeTar, outPipe io.Writer) error

func TeeCli

func TeeCli(call []string) (error, int)

CLI invocation for *SomeTee

func TestGzipItem

func TestGzipItem(item io.Reader) error

TODO: proper file checking (how to check validity?)

func TestGzipItems

func TestGzipItems(items []string) error

func TestItems

func TestItems(zipfile string, includeFiles []string, outPipe io.Writer, errPipe io.Writer) error

func TestTarItems

func TestTarItems(tarfile string, includeFiles []string, inPipe io.Reader, outPipe io.Writer) error

func TouchCli

func TouchCli(call []string) (error, int)

CLI invocation for *SomeTouch

func Tr

func Tr(set1, set2 string) someutils.CliPipable

Factory for normal `tr`

func TrC

func TrC(set1 string, set2 string) someutils.CliPipable

Factory for `tr -c` (complement)

func TrCli

func TrCli(call []string) (error, int)

Cli helper for tr

func TrD

func TrD(set1 string) someutils.CliPipable

Factory for `tr -d` (delete set1)

func UntarItems

func UntarItems(tarfile, destDir string, includeFiles []string, t *SomeTar, inPipe io.Reader, outPipe io.Writer) error

func UnzipCli

func UnzipCli(call []string) (error, int)

CLI invocation for *SomeUnzip

func UnzipItems

func UnzipItems(zipfile, destDir string, includeFiles []string, errPipe io.Writer) error

func WcCli

func WcCli(call []string) (error, int)

CLI invocation for *SomeWc

func WhichCli

func WhichCli(call []string) (error, int)

CLI invocation for *SomeWhich

func XargsCli

func XargsCli(call []string) (error, int)

CLI invocation for *SomeXargs

func ZipCli

func ZipCli(call []string) (error, int)

CLI invocation for *SomeZip

func ZipItems

func ZipItems(zipFilename string, itemsToArchive []string) error

Types

type SomeBasename

type SomeBasename struct {
	InputPath  string
	RelativeTo string
}

SomeBasename represents and performs a `basename` invocation

func (*SomeBasename) Invoke

func (basename *SomeBasename) Invoke(invocation *someutils.Invocation) (error, int)

Exec actually performs the basename

func (*SomeBasename) Name

func (basename *SomeBasename) Name() string

Name() returns the name of the util

func (*SomeBasename) ParseFlags

func (basename *SomeBasename) ParseFlags(call []string, errPipe io.Writer) (error, int)

ParseFlags parses flags from a commandline []string

type SomeCat

type SomeCat struct {
	IsShowEnds     bool
	IsNumber       bool
	IsSqueezeBlank bool
	FileNames      []string
}

SomeCat represents and performs a `cat` invocation

func NewCat

func NewCat() *SomeCat

func (*SomeCat) Invoke

func (cat *SomeCat) Invoke(invocation *someutils.Invocation) (error, int)

func (*SomeCat) Name

func (cat *SomeCat) Name() string

func (*SomeCat) Number

func (cat *SomeCat) Number() *SomeCat

func (*SomeCat) ParseFlags

func (cat *SomeCat) ParseFlags(call []string, errPipe io.Writer) (error, int)

func (*SomeCat) ShowEnds

func (cat *SomeCat) ShowEnds() *SomeCat

func (*SomeCat) SqueezeBlank

func (cat *SomeCat) SqueezeBlank() *SomeCat

type SomeCp

type SomeCp struct {
	// TODO: add members here
	IsRecursive bool
	SrcGlobs    []string
	Dest        string
}

SomeCp represents and performs a `cp` invocation

func Cp

func Cp(args ...string) *SomeCp

Factory for *SomeCp

func NewCp

func NewCp() *SomeCp

Factory for *SomeCp

func (*SomeCp) Invoke

func (cp *SomeCp) Invoke(invocation *someutils.Invocation) (error, int)

Exec actually performs the cp

func (*SomeCp) Name

func (cp *SomeCp) Name() string

Name() returns the name of the util

func (*SomeCp) ParseFlags

func (cp *SomeCp) ParseFlags(call []string, errPipe io.Writer) (error, int)

ParseFlags parses flags from a commandline []string

type SomeDirname

type SomeDirname struct {
	Filenames []string
}

SomeDirname represents and performs a `dirname` invocation

func Dirname

func Dirname(args ...string) *SomeDirname

Factory for *SomeDirname

func NewDirname

func NewDirname() *SomeDirname

Factory for *SomeDirname

func (*SomeDirname) Invoke

func (dirname *SomeDirname) Invoke(invocation *someutils.Invocation) (error, int)

Exec actually performs the dirname

func (*SomeDirname) Name

func (dirname *SomeDirname) Name() string

Name() returns the name of the util

func (*SomeDirname) ParseFlags

func (dirname *SomeDirname) ParseFlags(call []string, errPipe io.Writer) (error, int)

ParseFlags parses flags from a commandline []string

type SomeExec

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

SomeExec represents and performs a `exec` invocation

func (*SomeExec) Invoke

func (exe *SomeExec) Invoke(invocation *someutils.Invocation) (error, int)

Exec actually performs the exec

func (*SomeExec) Name

func (exe *SomeExec) Name() string

Name() returns the name of the util

type SomeGrep

type SomeGrep struct {
	IsPerl            bool
	IsExtended        bool
	IsIgnoreCase      bool
	IsInvertMatch     bool
	IsPrintFilename   bool
	IsPrintLineNumber bool
	IsRecurse         bool
	IsQuiet           bool
	LinesBefore       int
	LinesAfter        int
	LinesAround       int
	// contains filtered or unexported fields
}

SomeGrep represents and performs a `grep` invocation

func (*SomeGrep) Invoke

func (grep *SomeGrep) Invoke(invocation *someutils.Invocation) (error, int)

Exec actually performs the grep

func (*SomeGrep) Name

func (grep *SomeGrep) Name() string

Name() returns the name of the util

func (*SomeGrep) ParseFlags

func (grep *SomeGrep) ParseFlags(call []string, errPipe io.Writer) (error, int)

ParseFlags parses flags from a commandline []string

type SomeGunzip

type SomeGunzip struct {
	IsTest    bool
	IsKeep    bool
	IsPipeOut bool
	Filenames []string
}

SomeGunzip represents and performs `gunzip` invocations

func (*SomeGunzip) Invoke

func (gunzip *SomeGunzip) Invoke(invocation *someutils.Invocation) (error, int)

Exec actually performs the gunzip

func (*SomeGunzip) Name

func (gunzip *SomeGunzip) Name() string

Name() returns the name of the util

func (*SomeGunzip) ParseFlags

func (gunzip *SomeGunzip) ParseFlags(call []string, errPipe io.Writer) (error, int)

ParseFlags parses flags from a commandline []string

type SomeGzip

type SomeGzip struct {
	IsKeep    bool
	IsStdout  bool
	Filenames []string
	// contains filtered or unexported fields
}

SomeGzip represents and performs a `gzip` invocation

func (*SomeGzip) Invoke

func (gz *SomeGzip) Invoke(invocation *someutils.Invocation) (error, int)

Exec actually performs the gzip

func (*SomeGzip) Name

func (gz *SomeGzip) Name() string

Name() returns the name of the util

func (*SomeGzip) ParseFlags

func (gz *SomeGzip) ParseFlags(call []string, errPipe io.Writer) (error, int)

ParseFlags parses flags from a commandline []string

type SomeHead

type SomeHead struct {
	Filenames []string
	// contains filtered or unexported fields
}

SomeHead represents and performs a `head` invocation

func NewHead

func NewHead() *SomeHead

Factory for *SomeHead

func (*SomeHead) Invoke

func (head *SomeHead) Invoke(invocation *someutils.Invocation) (error, int)

Exec actually performs the head

func (*SomeHead) Name

func (head *SomeHead) Name() string

Name() returns the name of the util

func (*SomeHead) ParseFlags

func (head *SomeHead) ParseFlags(call []string, errPipe io.Writer) (error, int)

ParseFlags parses flags from a commandline []string

type SomeLs

type SomeLs struct {
	LongList   bool
	Recursive  bool
	Human      bool
	AllFiles   bool
	OnePerLine bool
	Stdin      bool
	// contains filtered or unexported fields
}

SomeLs represents and performs a `ls` invocation

func (*SomeLs) Invoke

func (ls *SomeLs) Invoke(invocation *someutils.Invocation) (error, int)

Exec actually performs the ls

func (*SomeLs) Name

func (ls *SomeLs) Name() string

Name() returns the name of the util

func (*SomeLs) ParseFlags

func (ls *SomeLs) ParseFlags(call []string, errPipe io.Writer) (error, int)

ParseFlags parses flags from a commandline []string

type SomeMv

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

SomeMv represents and performs a `mv` invocation

func Mv

func Mv(args ...string) *SomeMv

Factory for *SomeMv

func NewMv

func NewMv() *SomeMv

Factory for *SomeMv

func (*SomeMv) Invoke

func (mv *SomeMv) Invoke(invocation *someutils.Invocation) (error, int)

Exec actually performs the mv

func (*SomeMv) Name

func (mv *SomeMv) Name() string

Name() returns the name of the util

func (*SomeMv) ParseFlags

func (mv *SomeMv) ParseFlags(call []string, errPipe io.Writer) (error, int)

ParseFlags parses flags from a commandline []string

type SomePwd

type SomePwd struct {
}

SomePwd represents and performs a `pwd` invocation

func Pwd

func Pwd(args ...string) *SomePwd

Factory for *SomePwd

func (*SomePwd) Invoke

func (pwd *SomePwd) Invoke(invocation *someutils.Invocation) (error, int)

Exec actually performs the pwd

func (*SomePwd) Name

func (pwd *SomePwd) Name() string

Name() returns the name of the util

func (*SomePwd) ParseFlags

func (pwd *SomePwd) ParseFlags(call []string, errPipe io.Writer) (error, int)

ParseFlags parses flags from a commandline []string

type SomeRm

type SomeRm struct {
	IsRecursive bool
	// contains filtered or unexported fields
}

SomeRm represents and performs a `rm` invocation

func Rm

func Rm(args ...string) *SomeRm

Factory for *SomeRm

func (*SomeRm) Invoke

func (rm *SomeRm) Invoke(invocation *someutils.Invocation) (error, int)

Exec actually performs the rm

func (*SomeRm) Name

func (rm *SomeRm) Name() string

Name() returns the name of the util

func (*SomeRm) ParseFlags

func (rm *SomeRm) ParseFlags(call []string, errPipe io.Writer) (error, int)

ParseFlags parses flags from a commandline []string

type SomeSleep

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

SomeSleep represents and performs a `sleep` invocation

func NewSleep

func NewSleep() *SomeSleep

Factory for *SomeSleep

func Sleep

func Sleep(amount int, unit string) *SomeSleep

Factory for *SomeSleep

func (*SomeSleep) Invoke

func (sleep *SomeSleep) Invoke(invocation *someutils.Invocation) (error, int)

Exec actually performs the sleep

func (*SomeSleep) Name

func (sleep *SomeSleep) Name() string

Name() returns the name of the util

func (*SomeSleep) ParseFlags

func (sleep *SomeSleep) ParseFlags(call []string, errPipe io.Writer) (error, int)

ParseFlags parses flags from a commandline []string

type SomeTail

type SomeTail struct {
	Lines              int
	FollowByDescriptor bool
	FollowByName       bool
	SleepInterval      float64
	Filenames          []string
}

SomeTail represents and performs a `tail` invocation

func NewTail

func NewTail() *SomeTail

Factory for *SomeTail

func Tail

func Tail(args ...string) *SomeTail

Factory for *SomeTail

func (*SomeTail) Invoke

func (tail *SomeTail) Invoke(invocation *someutils.Invocation) (error, int)

Exec actually performs the tail

func (*SomeTail) Name

func (tail *SomeTail) Name() string

Name() returns the name of the util

func (*SomeTail) ParseFlags

func (tail *SomeTail) ParseFlags(call []string, errPipe io.Writer) (error, int)

ParseFlags parses flags from a commandline []string

type SomeTar

type SomeTar struct {
	IsCreate  bool
	IsList    bool
	IsExtract bool
	IsAppend  bool
	//IsCatenate bool
	IsVerbose       bool
	ArchiveFilename string
	// contains filtered or unexported fields
}

SomeTar represents and performs a `tar` invocation

func NewTar

func NewTar() *SomeTar

Factory for *SomeTar

func Tar

func Tar(archiveFilename string, args ...string) *SomeTar

Factory for *SomeTar

func (*SomeTar) Invoke

func (t *SomeTar) Invoke(invocation *someutils.Invocation) (error, int)

Exec actually performs the tar

func (*SomeTar) Name

func (tar *SomeTar) Name() string

Name() returns the name of the util

func (*SomeTar) ParseFlags

func (t *SomeTar) ParseFlags(call []string, errPipe io.Writer) (error, int)

ParseFlags parses flags from a commandline []string

type SomeTee

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

SomeTee represents and performs a `tee` invocation

func NewTee

func NewTee() *SomeTee

Factory for *SomeTee

func Tee

func Tee(args ...string) *SomeTee

Factory for *SomeTee

func (*SomeTee) Invoke

func (tee *SomeTee) Invoke(invocation *someutils.Invocation) (error, int)

Exec actually performs the tee

func (*SomeTee) Name

func (tee *SomeTee) Name() string

Name() returns the name of the util

func (*SomeTee) ParseFlags

func (tee *SomeTee) ParseFlags(call []string, errPipe io.Writer) (error, int)

ParseFlags parses flags from a commandline []string

type SomeTouch

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

SomeTouch represents and performs a `touch` invocation

func NewTouch

func NewTouch() *SomeTouch

Factory for *SomeTouch

func Touch

func Touch(args ...string) *SomeTouch

Factory for *SomeTouch

func (*SomeTouch) Invoke

func (touch *SomeTouch) Invoke(invocation *someutils.Invocation) (error, int)

Exec actually performs the touch

func (*SomeTouch) Name

func (touch *SomeTouch) Name() string

Name() returns the name of the util

func (*SomeTouch) ParseFlags

func (touch *SomeTouch) ParseFlags(call []string, errWriter io.Writer) (error, int)

ParseFlags parses flags from a commandline []string

type SomeTr

type SomeTr struct {
	IsDelete     bool
	IsSqueeze    bool
	IsComplement bool // currently unused as I just don't get it.
	// contains filtered or unexported fields
}

SomeTr mimics the functionality of the `tr` function from coreutils.

func NewTr

func NewTr() *SomeTr

func (*SomeTr) Invoke

func (tr *SomeTr) Invoke(invocation *someutils.Invocation) (error, int)

Invoke actually carries out the command

func (*SomeTr) Name

func (tr *SomeTr) Name() string

returns the name of the command

func (*SomeTr) ParseFlags

func (tr *SomeTr) ParseFlags(call []string, errWriter io.Writer) (error, int)

ParseFlags parses commandline options.

func (*SomeTr) Preprocess

func (tr *SomeTr) Preprocess() error

Parses SET1 and SET2 into a map of translations

type SomeUnzip

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

SomeUnzip represents and performs a `unzip` invocation

func NewUnzip

func NewUnzip() *SomeUnzip

Factory for *SomeUnzip

func Unzip

func Unzip(zipname string, files ...string) *SomeUnzip

Factory for *SomeUnzip

func (*SomeUnzip) Invoke

func (unzip *SomeUnzip) Invoke(invocation *someutils.Invocation) (error, int)

Exec actually performs the unzip

func (*SomeUnzip) Name

func (unzip *SomeUnzip) Name() string

Name() returns the name of the util

func (*SomeUnzip) ParseFlags

func (unzip *SomeUnzip) ParseFlags(call []string, errWriter io.Writer) (error, int)

ParseFlags parses flags from a commandline []string

type SomeWc

type SomeWc struct {
	IsBytes bool
	IsWords bool
	IsLines bool
	// contains filtered or unexported fields
}

SomeWc represents and performs a `wc` invocation

func NewWc

func NewWc() *SomeWc

Factory for *SomeWc

func Wc

func Wc(args ...string) *SomeWc

Factory for *SomeWc

func (*SomeWc) Invoke

func (wc *SomeWc) Invoke(invocation *someutils.Invocation) (error, int)

Exec actually performs the wc

func (*SomeWc) Name

func (wc *SomeWc) Name() string

Name() returns the name of the util

func (*SomeWc) ParseFlags

func (wc *SomeWc) ParseFlags(call []string, errWriter io.Writer) (error, int)

ParseFlags parses flags from a commandline []string

type SomeWhich

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

SomeWhich represents and performs a `which` invocation

func NewWhich

func NewWhich() *SomeWhich

Factory for *SomeWhich

func Which

func Which(args ...string) *SomeWhich

Factory for *SomeWhich

func (*SomeWhich) Invoke

func (which *SomeWhich) Invoke(invocation *someutils.Invocation) (error, int)

Exec actually performs the which

func (*SomeWhich) Name

func (which *SomeWhich) Name() string

Name() returns the name of the util

func (*SomeWhich) ParseFlags

func (which *SomeWhich) ParseFlags(call []string, errWriter io.Writer) (error, int)

ParseFlags parses flags from a commandline []string

type SomeXargs

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

SomeXargs represents and performs a `xargs` invocation

func NewXargs

func NewXargs() *SomeXargs

Factory for *SomeXargs

func Xargs

func Xargs(utilFactory someutils.CliPipableFactory, args ...string) *SomeXargs

Factory for *SomeXargs

func (*SomeXargs) Invoke

func (xargs *SomeXargs) Invoke(invocation *someutils.Invocation) (error, int)

Exec actually performs the xargs

func (*SomeXargs) Name

func (xargs *SomeXargs) Name() string

Name() returns the name of the util

func (*SomeXargs) ParseFlags

func (xargs *SomeXargs) ParseFlags(call []string, errPipe io.Writer) (error, int)

ParseFlags parses flags from a commandline []string

type SomeZip

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

SomeZip represents and performs a `zip` invocation

func NewZip

func NewZip() *SomeZip

Factory for *SomeZip

func Zip

func Zip(args ...string) *SomeZip

Factory for *SomeZip

func (*SomeZip) Invoke

func (z *SomeZip) Invoke(invocation *someutils.Invocation) (error, int)

Exec actually performs the zip

func (*SomeZip) Name

func (z *SomeZip) Name() string

Name() returns the name of the util

func (*SomeZip) ParseFlags

func (z *SomeZip) ParseFlags(call []string, errWriter io.Writer) (error, int)

ParseFlags parses flags from a commandline []string

Jump to

Keyboard shortcuts

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