mirror of
https://github.com/Hopiu/micro.git
synced 2026-03-29 20:30:25 +00:00
Add more commands
This commit is contained in:
parent
6f73172865
commit
b3bd735fdd
1 changed files with 10 additions and 1 deletions
|
|
@ -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()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue