diff --git a/cmd/repos.go b/cmd/repos.go new file mode 100644 index 00000000..dca5bb95 --- /dev/null +++ b/cmd/repos.go @@ -0,0 +1,24 @@ +package cmd + +import ( + "github.com/helmfile/helmfile/pkg/app" + "github.com/helmfile/helmfile/pkg/config" + "github.com/urfave/cli" +) + +func addReposSubcommand(cliApp *cli.App) { + cliApp.Commands = append(cliApp.Commands, cli.Command{ + Name: "repos", + Usage: "sync repositories from state file (helm repo add && helm repo update)", + Flags: []cli.Flag{ + cli.StringFlag{ + Name: "args", + Value: "", + Usage: "pass args to helm exec", + }, + }, + Action: Action(func(a *app.App, c config.ConfigImpl) error { + return a.Repos(c) + }), + }) +} diff --git a/cmd/root.go b/cmd/root.go index f9bb0f3d..a5e4821e 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -26,6 +26,7 @@ func RootCommand() *cli.App { // add subcommands addDepsSubcommand(cliApp) + addReposSubcommand(cliApp) return cliApp } diff --git a/main.go b/main.go index 7d099bca..14057132 100644 --- a/main.go +++ b/main.go @@ -14,20 +14,6 @@ func main() { rootCmd := cmd.RootCommand() subCommands := []cli.Command{ - { - Name: "repos", - Usage: "sync repositories from state file (helm repo add && helm repo update)", - Flags: []cli.Flag{ - cli.StringFlag{ - Name: "args", - Value: "", - Usage: "pass args to helm exec", - }, - }, - Action: cmd.Action(func(a *app.App, c config.ConfigImpl) error { - return a.Repos(c) - }), - }, { Name: "charts", Usage: "DEPRECATED: sync releases from state file (helm upgrade --install)",