Merge pull request #270 from tmlbl/master

Small REPL Improvements
This commit is contained in:
Barak Michener 2015-07-31 16:41:12 -04:00
commit 82919de240

View file

@ -60,7 +60,11 @@ func Run(query string, ses query.Session) {
nResults++ nResults++
} }
if nResults > 0 { if nResults > 0 {
fmt.Printf("-----------\n%d Results\n", nResults) results := "Result"
if nResults > 1 {
results += "s"
}
fmt.Printf("-----------\n%d %s\n", nResults, results)
} }
} }
@ -160,6 +164,10 @@ func Repl(h *graph.Handle, queryLanguage string, cfg *config.Config) error {
h.QuadWriter.RemoveQuad(quad) h.QuadWriter.RemoveQuad(quad)
continue continue
case "exit":
term.Close()
os.Exit(0)
default: default:
if cmd[0] == ':' { if cmd[0] == ':' {
fmt.Printf("Unknown command: %q\n", cmd) fmt.Printf("Unknown command: %q\n", cmd)