Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
ichinaski committed Aug 12, 2017
1 parent a00cb0f commit 4206eb5
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions main.go
Expand Up @@ -45,20 +45,19 @@ func draw(img image.Image) {
termbox.Flush()
}

func showInUI(image string) {
func display(image string) {
img, err := load(image)
if err != nil {
panic(err)
}

draw(img)

loop:
for {
switch ev := termbox.PollEvent(); ev.Type {
case termbox.EventKey:
if ev.Key == termbox.KeyEsc || ev.Ch == 'q' {
break loop
return
}
case termbox.EventResize:
draw(img)
Expand All @@ -83,6 +82,6 @@ func main() {
termbox.SetOutputMode(termbox.Output256)

for i := 1; i < len(os.Args); i++ {
showInUI(os.Args[i])
display(os.Args[i])
}
}

0 comments on commit 4206eb5

Please sign in to comment.