From 9bf0f9f65dc7f83bffc2f49f9fe83229bc5c355c Mon Sep 17 00:00:00 2001 From: Gregory Eremin Date: Tue, 16 Sep 2014 16:21:37 +0400 Subject: [PATCH] Add cli status handler --- cli/main.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/cli/main.go b/cli/main.go index 0ea73df..de17e67 100644 --- a/cli/main.go +++ b/cli/main.go @@ -92,6 +92,19 @@ func main() { } }, }, + { + Name: "status", + Usage: "Show server status", + Action: func(c *cli.Context) { + stat := bsq.Status() + + for _, queue := range stat { + fmt.Println(queue.Name) + fmt.Println(" Messages:", queue.Messages) + fmt.Println(" Subscribers:", queue.Subscribers) + } + }, + }, } app.CommandNotFound = func(c *cli.Context, cmd string) {