summaryrefslogtreecommitdiff
path: root/pkg/cli/query.go
diff options
context:
space:
mode:
authorStefan Majewsky <majewsky@gmx.net>2017-07-11 16:33:22 +0200
committerStefan Majewsky <majewsky@gmx.net>2017-07-11 16:33:22 +0200
commit888095449e80b33c1d5925e3164956567e43e86e (patch)
tree27436f3835ba18bb6b4b3b54e6dbb1de788e6120 /pkg/cli/query.go
parente8b31652a0a0fa1767d5e5d86fa9f7016057262c (diff)
downloadgofu-888095449e80b33c1d5925e3164956567e43e86e.tar.gz
prompt: draw separator line
Diffstat (limited to 'pkg/cli/query.go')
-rw-r--r--pkg/cli/query.go11
1 files changed, 5 insertions, 6 deletions
diff --git a/pkg/cli/query.go b/pkg/cli/query.go
index 2c53cfb..add170c 100644
--- a/pkg/cli/query.go
+++ b/pkg/cli/query.go
@@ -186,9 +186,7 @@ func displayChoices(out io.Writer, choices []Choice, selectedIndex int) {
}
}
-//AnsiEscapeRx is a regexp that matches full ANSI escape sequences that start
-//with the CSI.
-var AnsiEscapeRx = regexp.MustCompile(`^\x1B\[[\x20-\x3F]*[\x40-\x7E]`)
+var ansiEscapeRx = regexp.MustCompile(`^\x1B\[[\x20-\x3F]*[\x40-\x7E]`)
type buffer struct {
Input io.Reader
@@ -206,7 +204,7 @@ func (b *buffer) getNextInput() []byte {
}
//do we have a full ANSI escape sequence?
- match := AnsiEscapeRx.Find(b.buf[0:b.fill])
+ match := ansiEscapeRx.Find(b.buf[0:b.fill])
if match != nil {
result := append([]byte(nil), match...)
copy(b.buf[0:], b.buf[len(match):])
@@ -237,10 +235,11 @@ type pipeTUI struct {
i *Implementation
}
-var ansiColorCodeRx = regexp.MustCompile("\x1B" + `\[[0-9;]*m`)
+//AnsiColorCodeRx is a regexp that matches ANSI escape sequences of the type SGR.
+var AnsiColorCodeRx = regexp.MustCompile("\x1B" + `\[[0-9;]*m`)
func (t *pipeTUI) Print(w io.Writer, msg string) {
- w.Write([]byte(ansiColorCodeRx.ReplaceAllString(msg, "")))
+ w.Write([]byte(AnsiColorCodeRx.ReplaceAllString(msg, "")))
}
func (t *pipeTUI) ReadLine(prompt string) (string, error) {