From 8faeceac8e3bd587382a9abd15822d40d8ab8253 Mon Sep 17 00:00:00 2001 From: Josh Baker Date: Tue, 15 Mar 2016 18:21:56 -0700 Subject: [PATCH] updated command syntax --- README.md | 4 ++-- cmd/tile38-cli/main.go | 9 ++++++++- core/commands.json | 28 ++++++++++++++-------------- core/commands_gen.go | 28 ++++++++++++++-------------- 4 files changed, 38 insertions(+), 31 deletions(-) diff --git a/README.md b/README.md index 70616d9f..d8ccc9ae 100644 --- a/README.md +++ b/README.md @@ -65,7 +65,7 @@ $ ./tile38-cli > scan fleet # returns both trucks in 'fleet' > nearby fleet point 33.462 -112.268 6000 # search 6 kilometers around a point. returns one truck. -# crud operations +# key value operations > get fleet truck1 # returns 'truck1' > del fleet truck2 # deletes 'truck2' > drop fleet # removes all @@ -272,7 +272,7 @@ Currently we have only one native client written in Go. Though is should be triv ## Commands This is the full list of commands available to Tile38. -#### Crud +#### Keys ```md GET key id [OBJECT|POINT|BOUNDS|(HASH precision)] summary: Get the object of an id diff --git a/cmd/tile38-cli/main.go b/cmd/tile38-cli/main.go index 2d34ac8f..ed162d95 100644 --- a/cmd/tile38-cli/main.go +++ b/cmd/tile38-cli/main.go @@ -45,7 +45,14 @@ var ( ) func showHelp() bool { - fmt.Fprintf(os.Stdout, "tile38-cli %s (git:%s)\n\n", core.Version, core.GitSHA) + + gitsha := "" + if core.GitSHA == "" || core.GitSHA == "0000000" { + gitsha = "" + } else { + gitsha = " (git:" + core.GitSHA + ")" + } + fmt.Fprintf(os.Stdout, "tile38-cli %s%s\n\n", core.Version, gitsha) fmt.Fprintf(os.Stdout, "Usage: tile38-cli [OPTIONS] [cmd [arg [arg ...]]]\n") fmt.Fprintf(os.Stdout, " -h Server hostname (default: %s).\n", hostname) fmt.Fprintf(os.Stdout, " -p Server port (default: %d).\n", port) diff --git a/core/commands.json b/core/commands.json index 89199841..40774493 100644 --- a/core/commands.json +++ b/core/commands.json @@ -82,7 +82,7 @@ } ], "since": "1.0.0", - "group": "crud" + "group": "keys" }, "FSET": { "summary": "Set the value for a single field of an id", @@ -106,7 +106,7 @@ } ], "since": "1.0.0", - "group": "crud" + "group": "keys" }, "GET": { "summary": "Get the object of an id", @@ -137,8 +137,8 @@ "name": "HASH", "arguments": [ { - "name": "precision", - "type": "integer" + "name": "geohash", + "type": "geohash" } ] } @@ -146,7 +146,7 @@ } ], "since": "1.0.0", - "group": "crud" + "group": "keys" }, "DEL": { "summary": "Delete an id from a key", @@ -162,7 +162,7 @@ } ], "since": "1.0.0", - "group": "crud" + "group": "keys" }, "DROP": { "summary": "Remove a key from the database", @@ -174,7 +174,7 @@ } ], "since": "1.0.0", - "group": "crud" + "group": "keys" }, "KEYS": { "summary": "Finds all keys matching the given pattern", @@ -186,7 +186,7 @@ } ], "since": "1.0.0", - "group": "crud" + "group": "keys" }, "STATS": { "summary": "Show stats for one or more keys", @@ -199,7 +199,7 @@ } ], "since": "1.0.0", - "group": "crud" + "group": "keys" }, "SCAN": { @@ -522,8 +522,8 @@ "name": "HASH", "arguments": [ { - "name": "precision", - "type": "integer" + "name": "geohash", + "type": "geohash" } ] } @@ -690,8 +690,8 @@ "name": "HASH", "arguments": [ { - "name": "precision", - "type": "integer" + "name": "geohash", + "type": "geohash" } ] } @@ -780,7 +780,7 @@ "group": "replication" }, "AOF": { - "summary": "Downloads the AOF start from pos and keeps the connection alive", + "summary": "Downloads the AOF starting from pos and keeps the connection alive", "complexity": "O(1)", "arguments": [ { diff --git a/core/commands_gen.go b/core/commands_gen.go index ef657e50..cef9752e 100644 --- a/core/commands_gen.go +++ b/core/commands_gen.go @@ -235,7 +235,7 @@ var commandsJSON = `{ } ], "since": "1.0.0", - "group": "crud" + "group": "keys" }, "FSET": { "summary": "Set the value for a single field of an id", @@ -259,7 +259,7 @@ var commandsJSON = `{ } ], "since": "1.0.0", - "group": "crud" + "group": "keys" }, "GET": { "summary": "Get the object of an id", @@ -290,8 +290,8 @@ var commandsJSON = `{ "name": "HASH", "arguments": [ { - "name": "precision", - "type": "integer" + "name": "geohash", + "type": "geohash" } ] } @@ -299,7 +299,7 @@ var commandsJSON = `{ } ], "since": "1.0.0", - "group": "crud" + "group": "keys" }, "DEL": { "summary": "Delete an id from a key", @@ -315,7 +315,7 @@ var commandsJSON = `{ } ], "since": "1.0.0", - "group": "crud" + "group": "keys" }, "DROP": { "summary": "Remove a key from the database", @@ -327,7 +327,7 @@ var commandsJSON = `{ } ], "since": "1.0.0", - "group": "crud" + "group": "keys" }, "KEYS": { "summary": "Finds all keys matching the given pattern", @@ -339,7 +339,7 @@ var commandsJSON = `{ } ], "since": "1.0.0", - "group": "crud" + "group": "keys" }, "STATS": { "summary": "Show stats for one or more keys", @@ -352,7 +352,7 @@ var commandsJSON = `{ } ], "since": "1.0.0", - "group": "crud" + "group": "keys" }, "SCAN": { @@ -675,8 +675,8 @@ var commandsJSON = `{ "name": "HASH", "arguments": [ { - "name": "precision", - "type": "integer" + "name": "geohash", + "type": "geohash" } ] } @@ -843,8 +843,8 @@ var commandsJSON = `{ "name": "HASH", "arguments": [ { - "name": "precision", - "type": "integer" + "name": "geohash", + "type": "geohash" } ] } @@ -933,7 +933,7 @@ var commandsJSON = `{ "group": "replication" }, "AOF": { - "summary": "Downloads the AOF start from pos and keeps the connection alive", + "summary": "Downloads the AOF starting from pos and keeps the connection alive", "complexity": "O(1)", "arguments": [ {