diff --git a/README.md b/README.md index b808288ac..565f799ef 100644 --- a/README.md +++ b/README.md @@ -203,10 +203,6 @@ func ExecCommand(binName string, args []string, workDir ...string) (string, erro func ShellExec(cmdLine string, shells ...string) (string, error) func CurrentShell(onlyName bool) (path string) func HasShellEnv(shell string) bool -func Workdir() string -func BinDir() string -func BinFile() string -func BinName() string func BuildOptionHelpName(names []string) string func ShellQuote(s string) string func OutputLines(output string) []string @@ -245,14 +241,21 @@ func Errorln(a ...any) { color.Error.Println(a...) } func Warnp(a ...any) { color.Warn.Print(a...) } func Warnf(format string, a ...any) { color.Warn.Printf(format, a...) } func Warnln(a ...any) { color.Warn.Println(a...) } +// source at cliutil/info.go +func Workdir() string +func BinDir() string +func BinFile() string +func BinName() string +func GetTermSize(refresh ...bool) (w int, h int) // source at cliutil/read.go func ReadInput(question string) (string, error) func ReadLine(question string) (string, error) func ReadFirst(question string) (string, error) func ReadFirstByte(question string) (byte, error) func ReadFirstRune(question string) (rune, error) -// source at cliutil/read_nonwin.go func ReadPassword(question ...string) string +func InputIsYes(ans string) bool +func ByteIsYes(ans byte) bool ``` #### CLI Util Usage @@ -1380,10 +1383,4 @@ root@xx:/go/work# go test ./... ## License [MIT](LICENSE) -ort Map, Struct, Form data -- [gookit/goutil](https://github.com/gookit/goutil) Some utils for the Go: string, array/slice, map, format, cli, env, filesystem, test and more -- More, please see https://github.com/gookit -## License - -[MIT](LICENSE) diff --git a/README.zh-CN.md b/README.zh-CN.md index c71798d6b..829ffe39c 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -201,10 +201,6 @@ func ExecCommand(binName string, args []string, workDir ...string) (string, erro func ShellExec(cmdLine string, shells ...string) (string, error) func CurrentShell(onlyName bool) (path string) func HasShellEnv(shell string) bool -func Workdir() string -func BinDir() string -func BinFile() string -func BinName() string func BuildOptionHelpName(names []string) string func ShellQuote(s string) string func OutputLines(output string) []string @@ -243,14 +239,21 @@ func Errorln(a ...any) { color.Error.Println(a...) } func Warnp(a ...any) { color.Warn.Print(a...) } func Warnf(format string, a ...any) { color.Warn.Printf(format, a...) } func Warnln(a ...any) { color.Warn.Println(a...) } +// source at cliutil/info.go +func Workdir() string +func BinDir() string +func BinFile() string +func BinName() string +func GetTermSize(refresh ...bool) (w int, h int) // source at cliutil/read.go func ReadInput(question string) (string, error) func ReadLine(question string) (string, error) func ReadFirst(question string) (string, error) func ReadFirstByte(question string) (byte, error) func ReadFirstRune(question string) (rune, error) -// source at cliutil/read_nonwin.go func ReadPassword(question ...string) string +func InputIsYes(ans string) bool +func ByteIsYes(ans byte) bool ``` #### CLI Util Usage @@ -1372,9 +1375,3 @@ go test -v -run ^TestErr$ ./testutil/assert/... ## License [MIT](LICENSE) -(https://github.com/gookit/goutil) Some utils for the Go: string, array/slice, map, format, cli, env, filesystem, test and more -- More, please see https://github.com/gookit - -## License - -[MIT](LICENSE) diff --git a/cliutil/info_windows.go b/cliutil/info_windows.go index 8599ca46d..d955a0762 100644 --- a/cliutil/info_windows.go +++ b/cliutil/info_windows.go @@ -1,5 +1,7 @@ package cliutil +import "syscall" + // on Windows, must convert 'syscall.Stdin' to int func syscallStdinFd() int { return int(syscall.Stdin)