Change exit status (0: OK, 1: No match, 2: Error/Interrupted)

A la grep. Close #345
This commit is contained in:
Junegunn Choi
2015-09-15 13:21:51 +09:00
parent fa2f9f1f21
commit 65d9d416b4
6 changed files with 76 additions and 20 deletions

View File

@@ -261,7 +261,7 @@ func Init(theme *ColorTheme, black bool, mouse bool) {
_screen = C.newterm(nil, C.stderr, C.stdin)
if _screen == nil {
fmt.Println("Invalid $TERM: " + os.Getenv("TERM"))
os.Exit(1)
os.Exit(2)
}
C.set_term(_screen)
if mouse {
@@ -275,7 +275,7 @@ func Init(theme *ColorTheme, black bool, mouse bool) {
go func() {
<-intChan
Close()
os.Exit(1)
os.Exit(2)
}()
if theme != nil {