mirror of
https://github.com/hanzoai/bitping-example-client.git
synced 2026-10-30 18:46:57 +00:00
42 lines
760 B
Go
42 lines
760 B
Go
package cmd
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/codegangsta/cli"
|
|
"github.com/hanzoai/bitping-example-client/database"
|
|
)
|
|
|
|
var sharedDbFlags = append([]cli.Flag{}, cli.StringFlag{
|
|
Name: "db-path,p",
|
|
Usage: "database path",
|
|
Value: database.GetDatabasePath(),
|
|
})
|
|
|
|
var queryCmd = cli.Command{
|
|
Name: "query",
|
|
Usage: "query the databae",
|
|
Action: func(c *cli.Context) {
|
|
fmt.Printf("Querying the database")
|
|
},
|
|
}
|
|
|
|
var insertCmd = cli.Command{
|
|
Name: "insert",
|
|
Usage: "insert a query value",
|
|
Action: func(c *cli.Context) {
|
|
fmt.Printf("Insert a watchable value\n")
|
|
},
|
|
}
|
|
|
|
// DbCmd is the main database command
|
|
var DbCmd = cli.Command{
|
|
Name: "db",
|
|
Usage: "Database actions",
|
|
Flags: sharedDbFlags,
|
|
Subcommands: []cli.Command{
|
|
queryCmd,
|
|
insertCmd,
|
|
},
|
|
}
|