summaryrefslogtreecommitdiff
path: root/vendor/github.com/morikuni/aec/aec.go
diff options
context:
space:
mode:
authorNalin Dahyabhai <nalin@redhat.com>2019-10-24 10:37:22 -0400
committerNalin Dahyabhai <nalin@redhat.com>2019-10-29 13:35:18 -0400
commita4a70b4506ec4abb8b3bbc3873ee5ca015a8ed08 (patch)
tree4e7a50576d4db83450c58054e276f33bbd2cdb3a /vendor/github.com/morikuni/aec/aec.go
parent59582c55b798f0a2d086981ca9a8ddd8314fd0c2 (diff)
downloadpodman-a4a70b4506ec4abb8b3bbc3873ee5ca015a8ed08.tar.gz
podman-a4a70b4506ec4abb8b3bbc3873ee5ca015a8ed08.tar.bz2
podman-a4a70b4506ec4abb8b3bbc3873ee5ca015a8ed08.zip
bump containers/image to v5.0.0, buildah to v1.11.4
Move to containers/image v5 and containers/buildah to v1.11.4. Replace an equality check with a type assertion when checking for a docker.ErrUnauthorizedForCredentials in `podman login`. Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Diffstat (limited to 'vendor/github.com/morikuni/aec/aec.go')
-rw-r--r--vendor/github.com/morikuni/aec/aec.go137
1 files changed, 137 insertions, 0 deletions
diff --git a/vendor/github.com/morikuni/aec/aec.go b/vendor/github.com/morikuni/aec/aec.go
new file mode 100644
index 000000000..566be6eb1
--- /dev/null
+++ b/vendor/github.com/morikuni/aec/aec.go
@@ -0,0 +1,137 @@
+package aec
+
+import "fmt"
+
+// EraseMode is listed in a variable EraseModes.
+type EraseMode uint
+
+var (
+ // EraseModes is a list of EraseMode.
+ EraseModes struct {
+ // All erase all.
+ All EraseMode
+
+ // Head erase to head.
+ Head EraseMode
+
+ // Tail erase to tail.
+ Tail EraseMode
+ }
+
+ // Save saves the cursor position.
+ Save ANSI
+
+ // Restore restores the cursor position.
+ Restore ANSI
+
+ // Hide hides the cursor.
+ Hide ANSI
+
+ // Show shows the cursor.
+ Show ANSI
+
+ // Report reports the cursor position.
+ Report ANSI
+)
+
+// Up moves up the cursor.
+func Up(n uint) ANSI {
+ if n == 0 {
+ return empty
+ }
+ return newAnsi(fmt.Sprintf(esc+"%dA", n))
+}
+
+// Down moves down the cursor.
+func Down(n uint) ANSI {
+ if n == 0 {
+ return empty
+ }
+ return newAnsi(fmt.Sprintf(esc+"%dB", n))
+}
+
+// Right moves right the cursor.
+func Right(n uint) ANSI {
+ if n == 0 {
+ return empty
+ }
+ return newAnsi(fmt.Sprintf(esc+"%dC", n))
+}
+
+// Left moves left the cursor.
+func Left(n uint) ANSI {
+ if n == 0 {
+ return empty
+ }
+ return newAnsi(fmt.Sprintf(esc+"%dD", n))
+}
+
+// NextLine moves down the cursor to head of a line.
+func NextLine(n uint) ANSI {
+ if n == 0 {
+ return empty
+ }
+ return newAnsi(fmt.Sprintf(esc+"%dE", n))
+}
+
+// PreviousLine moves up the cursor to head of a line.
+func PreviousLine(n uint) ANSI {
+ if n == 0 {
+ return empty
+ }
+ return newAnsi(fmt.Sprintf(esc+"%dF", n))
+}
+
+// Column set the cursor position to a given column.
+func Column(col uint) ANSI {
+ return newAnsi(fmt.Sprintf(esc+"%dG", col))
+}
+
+// Position set the cursor position to a given absolute position.
+func Position(row, col uint) ANSI {
+ return newAnsi(fmt.Sprintf(esc+"%d;%dH", row, col))
+}
+
+// EraseDisplay erases display by given EraseMode.
+func EraseDisplay(m EraseMode) ANSI {
+ return newAnsi(fmt.Sprintf(esc+"%dJ", m))
+}
+
+// EraseLine erases lines by given EraseMode.
+func EraseLine(m EraseMode) ANSI {
+ return newAnsi(fmt.Sprintf(esc+"%dK", m))
+}
+
+// ScrollUp scrolls up the page.
+func ScrollUp(n int) ANSI {
+ if n == 0 {
+ return empty
+ }
+ return newAnsi(fmt.Sprintf(esc+"%dS", n))
+}
+
+// ScrollDown scrolls down the page.
+func ScrollDown(n int) ANSI {
+ if n == 0 {
+ return empty
+ }
+ return newAnsi(fmt.Sprintf(esc+"%dT", n))
+}
+
+func init() {
+ EraseModes = struct {
+ All EraseMode
+ Head EraseMode
+ Tail EraseMode
+ }{
+ Tail: 0,
+ Head: 1,
+ All: 2,
+ }
+
+ Save = newAnsi(esc + "s")
+ Restore = newAnsi(esc + "u")
+ Hide = newAnsi(esc + "?25l")
+ Show = newAnsi(esc + "?25h")
+ Report = newAnsi(esc + "6n")
+}