gogs-cli/cmd/repo-list.go
Mr. Is 560eae6308 💾
2016-07-27 20:11:57 -04:00

29 lines
428 B
Go

package cmd
import (
"fmt"
"github.com/spf13/cobra"
)
var listCmd = &cobra.Command{
Use: "list",
Short: "List your repositories.",
Long: "List all your repositories.",
Run: func(cmd *cobra.Command, args []string) {
repos, err := GetClient().ListMyRepos()
if err != nil {
fmt.Println(err)
return
}
for _, repo := range repos {
printRepo(repo)
}
},
}
func init() {
repoCmd.AddCommand(listCmd)
}