cli

package
v1.9.46 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2024 License: MIT Imports: 27 Imported by: 16

Documentation

Index

Constants

View Source
const (
	BG     = "bg"
	FG     = "fg"
	COLOR  = "color"
	BLACK  = "black"
	WHITE  = "white"
	BLUE   = "blue"
	RED    = "red"
	GRAY   = "gray"
	CYAN   = "cyan"
	GREEN  = "green"
	SILVER = "silver"
	PURPLE = "purple"
	YELLOW = "yellow"
	RANDOM = "random"
	TRANS  = "#0000"
	LIGHT  = "light"
	DARK   = "dark"
)
View Source
const (
	DIR  = "dir"
	ENV  = "env"
	API  = "api"
	MOD  = "mod"
	PWD  = "pwd"
	PID  = "pid"
	PPID = "ppid"
)
View Source
const (
	BUILD = "build"
	ORDER = "order"
	SPAWN = "spawn"
	CHECK = "check"
	BENCH = "bench"
	PPROF = "pprof"

	TIMEOUT  = "timeout"
	STATUS   = "status"
	ERROR    = "error"
	CLEAR    = "clear"
	STASH    = "stash"
	DELAY    = "delay"
	RECORD   = "record"
	RELOAD   = "reload"
	REBOOT   = "reboot"
	RESTART  = "restart"
	INTERVAL = "interval"
	OPTS     = "opts"
	ARGS     = "args"
	LOGS     = "logs"

	BEGIN = "begin"
	END   = "end"
	START = "start"
	STOP  = "stop"
	OPEN  = "open"
	CLOSE = "close"

	PLAY = "play"
	MAIN = "main"
	CODE = "code"
	COST = "cost"
	FROM = "from"
	BACK = "back"
)
View Source
const (
	CMD     = "cmd"
	ADD     = "add"
	OSID    = "osid"
	REPOS   = "repos"
	UBUNTU  = "ubuntu"
	CENTOS  = "centos"
	ALPINE  = "alpine"
	BUSYBOX = "busybox"
	RELEASE = "release"
	RHEL    = "rhel"

	ETC_OS_RELEASE = "/etc/os-release"
	ETC_APK_REPOS  = "/etc/apk/repositories"
)
View Source
const (
	MAKE = "make"
	TEST = "test"
	HOST = "host"
	CONF = "conf"
	BOOT = "boot"
	NODE = "node"
)
View Source
const (
	GOARCH  = "GOARCH"
	AMD64   = "amd64"
	X86     = "386"
	ARM     = "arm"
	ARM64   = "arm64"
	MIPSLE  = "mipsle"
	GOOS    = "GOOS"
	LINUX   = "linux"
	MACOS   = "macos"
	DARWIN  = "darwin"
	WINDOWS = "windows"

	COMMIT_TIME  = "commitTime"
	COMPILE_TIME = "compileTime"
	BOOT_TIME    = "bootTime"

	KERNEL = "kernel"
	ARCH   = "arch"
)
View Source
const (
	PATH  = "PATH"
	HOME  = "HOME"
	USER  = "USER"
	TERM  = "TERM"
	SHELL = "SHELL"
	LANG  = "LANG"
	TZ    = "TZ"
)
View Source
const (
	CTX_SHY    = "ctx_shy"
	CTX_DEV    = "ctx_dev"
	CTX_DEV_IP = "ctx_dev_ip"
	CTX_OPS    = "ctx_ops"
	CTX_REPOS  = "ctx_repos"
	CTX_NAME   = "ctx_name"
	CTX_DEMO   = "ctx_demo"
	CTX_MAIL   = "ctx_mail"
	CTX_ROOT   = "ctx_root"

	CTX_PID = "ctx_pid"
	CTX_LOG = "ctx_log"
	CTX_POD = "ctx_pod"
	CTX_ENV = "ctx_env"
	CTX_CLI = "ctx_cli"
	CTX_ARG = "ctx_arg"
)
View Source
const (
	USERNAME = "username"
	HOSTNAME = "hostname"
	PATHNAME = "pathname"
)
View Source
const (
	IFCONFIG = "ifconfig"
	DISKINFO = "diskinfo"
	HOSTINFO = "hostinfo"
	USERINFO = "userinfo"
	BOOTINFO = "bootinfo"
	MAXPROCS = "maxprocs"
)
View Source
const (
	TIME_300ms = "300ms"
	TIME_30ms  = "30ms"
	TIME_30s   = "30s"
	TIME_3s    = "3s"
	TIME_1s    = "1s"

	CMD_DIR = "cmd_dir"
	CMD_ENV = "cmd_env"

	CMD_INPUT  = "cmd_input"
	CMD_OUTPUT = "cmd_output"
	CMD_ERRPUT = "cmd_errput"

	CMD_ERR = "cmd_err"
	CMD_OUT = "cmd_out"

	RUN   = "run"
	REST  = "rest"
	PARAM = "param"
	OPENS = "opens"
	RELAY = "relay"
)
View Source
const (
	SH  = "sh"
	LN  = "ln"
	MV  = "mv"
	RM  = "rm"
	CD  = "cd"
	CAT = "cat"

	FIND = "find"
	GREP = "grep"
	TAIL = "tail"
	WGET = "wget"
	CURL = "curl"

	SUDO = "sudo"
	EXEC = "exec"
	EXIT = "exit"
	ECHO = "echo"
	KILL = "kill"

	GO     = "go"
	GOTAGS = "gotags"
	GIT    = "git"
	MAN    = "man"
	YUM    = "yum"
)
View Source
const CLI = "cli"
View Source
const DAEMON = "daemon"
View Source
const FOREVER = "forever"
View Source
const MIRRORS = "mirrors"
View Source
const QRCODE = "qrcode"
View Source
const RUNTIME = "runtime"
View Source
const (
	SIZE = "size"
)
View Source
const SYSTEM = "system"

Variables

View Source
var ENV_LIST = []string{TZ, LANG, TERM, SHELL, CTX_SHY, CTX_DEV, CTX_OPS, CTX_DEMO, CTX_MAIL, CTX_ROOT, CTX_PID}
View Source
var Index = &ice.Context{Name: CLI, Help: "命令模块"}

Functions

func BinPath added in v0.9.8

func BinPath(arg ...string) string

func Color

func Color(m *ice.Message, c string, str ice.Any) string

func ColorGreen

func ColorGreen(m *ice.Message, str ice.Any) string

func ColorRed

func ColorRed(m *ice.Message, str ice.Any) string

func ColorYellow

func ColorYellow(m *ice.Message, str ice.Any) string

func EtcPath added in v1.6.1

func EtcPath(m *ice.Message) (res []string)

func IsAlpine added in v1.1.2

func IsAlpine(m *ice.Message, arg ...string) bool

func IsRedhat added in v1.8.1

func IsRedhat(m *ice.Message, arg ...string) bool

func IsSuccess added in v0.6.1

func IsSuccess(m *ice.Message) bool

func IsSystem added in v1.4.4

func IsSystem(m *ice.Message, arg ...string) bool

func IsWindows added in v1.5.5

func IsWindows() bool

func NodeInfo

func NodeInfo(m *ice.Message, arg ...string)

func OSAScript added in v1.8.3

func OSAScript(m *ice.Message, arg ...string)

func OpenCmds added in v1.5.19

func OpenCmds(m *ice.Message, arg ...string) *ice.Message

func Opens added in v1.5.5

func Opens(m *ice.Message, arg ...string)

func ParseCliColor added in v1.5.5

func ParseCliColor(color string) string

func ParseColor added in v1.5.5

func ParseColor(color string) color.Color

func ParseMake added in v1.8.3

func ParseMake(str string) []string

func Prefix added in v1.8.0

func Prefix(arg ...string) string

func Shell added in v1.8.3

func Shell(m *ice.Message) string

func SimpleMake added in v1.8.5

func SimpleMake() []string

func SystemCmds added in v1.4.3

func SystemCmds(m *ice.Message, cmds string, args ...ice.Any) string

func SystemExec added in v1.4.3

func SystemExec(m *ice.Message, arg ...string) string

func SystemFind added in v0.9.6

func SystemFind(m *ice.Message, bin string, dir ...string) string

func SystemFindGit added in v1.8.8

func SystemFindGit(m *ice.Message) bool

func SystemFindGo added in v1.8.7

func SystemFindGo(m *ice.Message) bool

func TellApp added in v1.8.3

func TellApp(m *ice.Message, app string, arg ...string)

Types

This section is empty.

Jump to

Keyboard shortcuts

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