butil

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package butil bin util package will not run the init(), but bin will

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppFilename added in v1.3.0

func AppFilename() string

func AppName added in v1.3.0

func AppName() string

AppName get current binary application name

func Basedir added in v1.3.0

func Basedir() string

Basedir get application binary root dir.

func Clear

func Clear() error

Clear @experimental it's a try clear the cli app

func DetectPath added in v1.3.0

func DetectPath(vPath string) string

DetectPath detect path by give relative or absolute path, can correct incorrect paths normally.

func InputOption added in v1.2.0

func InputOption(title, def string) string

InputOption need input data from stdin optional

func InputRequire added in v1.2.0

func InputRequire(title string, validFunc func(string) bool) string

InputRequire required input data from stdin

func Pwd added in v1.4.2

func Pwd(joins ...string) string

Pwd try to get the current working directory

func RootPath added in v1.3.0

func RootPath(vPath string) string

RootPath the path dir by application same location.

func StringToArgs

func StringToArgs(str string) []string

StringToArgs make the string to bin/Args, it's used in interactive cli

func StringToMultiArgs

func StringToMultiArgs(str string) [][]string

StringToMultiArgs string line parse multi line, support ";" split.

Types

type BinInfo added in v1.4.0

type BinInfo struct {
	BaseDir      string
	Name         string
	NameNoSuffix string
}

BinInfo by parse binary.

func Current added in v1.4.0

func Current() BinInfo

Current get the current application's `BinInfo`

Jump to

Keyboard shortcuts

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