From 46426ee8d08480de531bc423f91e418026ca3c60 Mon Sep 17 00:00:00 2001 From: Rick Olson Date: Thu, 26 Jun 2014 14:54:48 -0600 Subject: [PATCH] update queues command --- commands/command_queues.go | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/commands/command_queues.go b/commands/command_queues.go index c36f1bcc..64ff4b2f 100644 --- a/commands/command_queues.go +++ b/commands/command_queues.go @@ -3,16 +3,21 @@ package commands import ( "github.com/github/git-media/gitmedia" "github.com/github/git-media/queuedir" + "github.com/spf13/cobra" "os" "path/filepath" "strings" ) -type QueuesCommand struct { - *Command -} +var ( + queuesCmd = &cobra.Command{ + Use: "queues", + Short: "Show the status of the internal Git Media queues.", + Run: queuesCommand, + } +) -func (c *QueuesCommand) Run() { +func queuesCommand(cmd *cobra.Command, args []string) { err := gitmedia.WalkQueues(func(name string, queue *queuedir.Queue) error { wd, _ := os.Getwd() Print(name) @@ -35,7 +40,5 @@ func (c *QueuesCommand) Run() { } func init() { - registerCommand("queues", func(c *Command) RunnableCommand { - return &QueuesCommand{Command: c} - }) + RootCmd.AddCommand(queuesCmd) }