Implement --expect option to support simple key bindings (#163)

This commit is contained in:
Junegunn Choi
2015-03-29 02:59:32 +09:00
parent 9cfecf7f0b
commit 2a167aa030
9 changed files with 172 additions and 5 deletions

View File

@@ -61,6 +61,10 @@ func DurWithin(
return val
}
func Between(val int, min int, max int) bool {
return val >= min && val <= max
}
// IsTty returns true is stdin is a terminal
func IsTty() bool {
return int(C.isatty(C.int(os.Stdin.Fd()))) != 0