Skip to content

Commit eecebfb

Browse files
committed
Adding marathonctl package list command for #2
1 parent 5b9f767 commit eecebfb

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

cmd/package_list.go

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
package cmd
2+
3+
import (
4+
"fmt"
5+
"github.com/ashwanthkumar/marathonctl/packages"
6+
"github.com/spf13/cobra"
7+
)
8+
9+
var PackageList = &cobra.Command{
10+
Use: "list",
11+
Short: "List all the package repositories",
12+
Long: "List all the package repositories",
13+
Run: AttachHandler(listPackageRepositories),
14+
}
15+
16+
func listPackageRepositories(args []string) (err error) {
17+
for _, repository := range *packages.AllRepos {
18+
fmt.Printf("%s\t%s\n", repository.Name, repository.Loc)
19+
}
20+
return err
21+
}
22+
23+
func init() {
24+
Package.AddCommand(PackageList)
25+
}

0 commit comments

Comments
 (0)