add thing
This commit is contained in:
10
cli/cli.go
10
cli/cli.go
@@ -3,12 +3,13 @@ package main
|
||||
import (
|
||||
"bufio"
|
||||
"fmt"
|
||||
"gogs.inhome.blapointe.com/local/args"
|
||||
"gogs.inhome.blapointe.com/local/storage"
|
||||
"log"
|
||||
"os"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"gogs.inhome.blapointe.com/local/args"
|
||||
"gogs.inhome.blapointe.com/local/storage"
|
||||
)
|
||||
|
||||
func main() {
|
||||
@@ -17,7 +18,7 @@ func main() {
|
||||
as.Append(args.STRING, "db", "type of store", "dynomite")
|
||||
as.Append(args.STRING, "user", "user of store", "")
|
||||
as.Append(args.STRING, "pass", "pass of store", "")
|
||||
as.Append(args.STRING, "do", "[get set]", "get")
|
||||
as.Append(args.STRING, "do", "[get set del list]", "get")
|
||||
as.Append(args.STRING, "k", "key", "key")
|
||||
as.Append(args.STRING, "v", "value", "value")
|
||||
as.Append(args.STRING, "ns", "namespace", "")
|
||||
@@ -52,6 +53,9 @@ func main() {
|
||||
case "set":
|
||||
ns := strings.Split(as.Get("ns").GetString(), " ")
|
||||
err = db.Set(as.Get("k").GetString(), []byte(as.Get("v").GetString()), ns...)
|
||||
case "del":
|
||||
ns := strings.Split(as.Get("ns").GetString(), " ")
|
||||
err = db.Set(as.Get("k").GetString(), nil, ns...)
|
||||
case "cli":
|
||||
reader := bufio.NewReader(os.Stdin)
|
||||
for {
|
||||
|
||||
Reference in New Issue
Block a user