add counter app in python

This commit is contained in:
Ethan Buchman
2015-12-14 19:58:51 -05:00
parent 4a0469d3ec
commit bb4a58aa0a
6 changed files with 421 additions and 0 deletions
+20
View File
@@ -45,6 +45,13 @@ func main() {
cmdConsole(app, c)
},
},
{
Name: "echo",
Usage: "Have the application echo a message",
Action: func(c *cli.Context) {
cmdEcho(c)
},
},
{
Name: "info",
Usage: "Get some info about the application",
@@ -140,6 +147,19 @@ func cmdConsole(app *cli.App, c *cli.Context) {
}
}
// Have the application echo a message
func cmdEcho(c *cli.Context) {
args := c.Args()
if len(args) != 1 {
Exit("echo takes 1 argument")
}
res, err := makeRequest(conn, types.RequestEcho{args[0]})
if err != nil {
Exit(err.Error())
}
fmt.Println(res)
}
// Get some info from the application
func cmdInfo(c *cli.Context) {
res, err := makeRequest(conn, types.RequestInfo{})