diff options
author | Junegunn Choi <junegunn.c@gmail.com> | 2015-03-29 02:59:32 +0900 |
---|---|---|
committer | Junegunn Choi <junegunn.c@gmail.com> | 2015-03-29 02:59:32 +0900 |
commit | 2a167aa030b244060fc479d2b88fdb9b9171d026 (patch) | |
tree | 69b994e5b97ad9a07107569fcb1227de7c886cbb /src/util/util.go | |
parent | 9cfecf7f0bb52441c27b769427fdf05f45b3110d (diff) |
Implement --expect option to support simple key bindings (#163)
Diffstat (limited to 'src/util/util.go')
-rw-r--r-- | src/util/util.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/util/util.go b/src/util/util.go index 1f53cc76..2d680b1a 100644 --- a/src/util/util.go +++ b/src/util/util.go @@ -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 |