base

package
v0.0.0-...-5a06578 Latest Latest
Warning

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

Go to latest
Published: May 7, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	REQUIRED int = iota
	NOARG
	OPTIONAL
)

option argument type

Variables

View Source
var (
	ErrNilArgv       = errors.New("argv is nil")
	ErrUnExpectedArg = errors.New("unexpected argument '-'")
)

error

View Source
var (
	IsDebugMode bool
)

defined

Functions

func BufferCat

func BufferCat(sv ...string) []byte

BufferCat todo

func ByteCat

func ByteCat(sv ...[]byte) string

ByteCat cat strings: You should know that StrCat gradually builds advantages only when the number of parameters is> 2.

func DbgPrint

func DbgPrint(format string, a ...interface{})

DbgPrint todo

func ErrorCat

func ErrorCat(sv ...string) error

ErrorCat todo

func FixupTerminal

func FixupTerminal()

func MoveFile

func MoveFile(oldpath, newpath string) error

MoveFile file

func PathIsSlipVulnerability

func PathIsSlipVulnerability(p string) bool

PathIsSlipVulnerability todo

func SaveFile

func SaveFile(in io.Reader, path string, fm os.FileMode, replace bool) error

SaveFile save file to filesystem

func SplitPath

func SplitPath(p string) []string

SplitPath skip empty string suggestcap is suggest cap

func StrCat

func StrCat(sv ...string) string

StrCat cat strings: You should know that StrCat gradually builds advantages only when the number of parameters is> 2.

func StrSplitSkipEmpty

func StrSplitSkipEmpty(s string, sep byte, suggestcap int) []string

StrSplitSkipEmpty skip empty string suggestcap is suggest cap

Types

type ParseArgs

type ParseArgs struct {
	SubcmdMode bool // subcmd mode
	// contains filtered or unexported fields
}

ParseArgs todo

func (*ParseArgs) Add

func (pa *ParseArgs) Add(name string, ha, val int)

Add option

func (*ParseArgs) Execute

func (pa *ParseArgs) Execute(argv []string, ac Receiver) error

Execute todo

func (*ParseArgs) Unresolved

func (pa *ParseArgs) Unresolved() []string

Unresolved todo

type Receiver

type Receiver interface {
	Invoke(val int, oa, raw string) error
}

Receiver todo

Jump to

Keyboard shortcuts

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