reg/tags.go
Jess Frazelle a3b459b1a5
refactor client
Signed-off-by: Jess Frazelle <acidburn@microsoft.com>
2018-03-06 09:12:29 -05:00

29 lines
435 B
Go

package main
import (
"fmt"
"strings"
"github.com/urfave/cli"
)
var tagsCommand = cli.Command{
Name: "tags",
Usage: "get the tags for a repository",
Action: func(c *cli.Context) error {
if len(c.Args()) < 1 {
return fmt.Errorf("pass the name of the repository")
}
tags, err := r.Tags(c.Args()[0])
if err != nil {
return err
}
// Print the tags.
fmt.Println(strings.Join(tags, "\n"))
return nil
},
}