diff options
author | obscuren <obscuren@obscura.com> | 2014-01-01 21:11:56 +0800 |
---|---|---|
committer | obscuren <obscuren@obscura.com> | 2014-01-01 21:11:56 +0800 |
commit | 65f00656f224546b1b3ed3cd8217236963f770df (patch) | |
tree | 9b09d8a9bb155cefdf4e3f4fbd09e4744a3728c2 | |
parent | 30f3b4d4e435aed02033d97d69361c78db7d6d7f (diff) | |
download | dexon-65f00656f224546b1b3ed3cd8217236963f770df.tar.gz dexon-65f00656f224546b1b3ed3cd8217236963f770df.tar.zst dexon-65f00656f224546b1b3ed3cd8217236963f770df.zip |
Help text
-rw-r--r-- | db_query_interface.go | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/db_query_interface.go b/db_query_interface.go index 1bcf1e72d..572dd6684 100644 --- a/db_query_interface.go +++ b/db_query_interface.go @@ -32,9 +32,6 @@ func (i *DbInterface) ValidateInput(action string, argumentLength int) error { case action == "get" && argumentLength != 1: err = true expArgCount = 1 - case (action == "quit" || action == "exit") && argumentLength != 0: - err = true - expArgCount = 0 } if err { @@ -73,6 +70,11 @@ func (i *DbInterface) ParseInput(input string) bool { fmt.Println(i.trie.Get(tokens[1])) case "exit", "quit", "q": return false + case "help": + fmt.Println(`query commands: +update KEY VALUE +get KEY +`) default: fmt.Println("Unknown command:", tokens[0]) } @@ -82,6 +84,7 @@ func (i *DbInterface) ParseInput(input string) bool { } func (i *DbInterface) Start() { + fmt.Printf("DB Query tool. Type (help) for help\n") reader := bufio.NewReader(os.Stdin) for { fmt.Printf("db >>> ") |