From 75cbba95e7f24b0a6e0e0c32f023ddac42cf05de Mon Sep 17 00:00:00 2001 From: Michelle Noorali Date: Wed, 16 Mar 2016 13:59:01 -0600 Subject: [PATCH] feat(repo): stub repo client commands --- cmd/helm/repository.go | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/cmd/helm/repository.go b/cmd/helm/repository.go index 520f2f6a3..9340e102e 100644 --- a/cmd/helm/repository.go +++ b/cmd/helm/repository.go @@ -18,6 +18,8 @@ package main import ( "github.com/codegangsta/cli" + "github.com/kubernetes/deployment-manager/pkg/format" + "os" ) func init() { @@ -40,6 +42,12 @@ func repoCommands() cli.Command { Usage: "The name of the credential.", }, }, + Action: func(c *cli.Context) { + if err := addRepo(c); err != nil { + format.Err("%s Error adding chart repo: ", err) + os.Exit(1) + } + }, }, { Name: "show", @@ -50,13 +58,45 @@ func repoCommands() cli.Command { Name: "list", Usage: "List the repositories on the remote manager.", ArgsUsage: "", + Action: func(c *cli.Context) { + if err := listRepos(c); err != nil { + format.Err("%s Error listing chart repositories: ", err) + os.Exit(1) + } + }, }, { Name: "remove", Aliases: []string{"rm"}, Usage: "Remove a repository from the remote manager.", ArgsUsage: "REPOSITORY", + Action: func(c *cli.Context) { + if err := removeRepo(c); err != nil { + format.Err("%s Error removing chart repo: ", err) + os.Exit(1) + } + }, }, }, } } + +func addRepo(c *cli.Context) error { + args := c.Args() + if len(args) < 1 { + return errors.New("'helm repo add' requires a repository as an argument") + } + return nil +} + +func listRepos(c *cli.Context) error { + return nil +} + +func removeRepo(c *cli.Context) error { + args := c.Args() + if len(args) < 1 { + return errors.New("'helm repo remove' requires a repository as an argument") + } + return nil +}