From b3bd735fddda74b61028fb090abda0b7b9f51249 Mon Sep 17 00:00:00 2001 From: Zachary Yedidia Date: Tue, 29 Mar 2016 20:51:32 -0400 Subject: [PATCH] Add more commands --- src/command.go | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/command.go b/src/command.go index 0c72209e..28474361 100644 --- a/src/command.go +++ b/src/command.go @@ -1,6 +1,7 @@ package main import ( + "os" "strings" ) @@ -8,7 +9,15 @@ import ( func HandleCommand(input string, view *View) { cmd := strings.Split(input, " ")[0] args := strings.Split(input, " ")[1:] - if cmd == "set" { + switch cmd { + case "set": SetOption(view, args) + case "quit": + if view.CanClose("Quit anyway? ") { + screen.Fini() + os.Exit(0) + } + case "save": + view.Save() } }