diff --git a/cmd/tide/uninstall.go b/cmd/tide/down.go similarity index 89% rename from cmd/tide/uninstall.go rename to cmd/tide/down.go index 460305a..112a12e 100644 --- a/cmd/tide/uninstall.go +++ b/cmd/tide/down.go @@ -16,15 +16,15 @@ chart in the current working directory. ` var uninstallCmd = &cobra.Command{ - Use: "uninstall [CHART]", - Short: "uninstall a chart archive.", + Use: "down [CHART]", + Short: "Delete a chart archive from Kubernetes.", Long: uninstallDesc, RunE: runUninstall, } func runUninstall(cmd *cobra.Command, args []string) error { log.SetOutput(ioutil.Discard) - setupInstallEnv(args) + setupUninstallEnv(args) manifest, _ := readManifest(installArg) execute("delete", manifest) return nil diff --git a/cmd/tide/install.go b/cmd/tide/install.go deleted file mode 100644 index 04457e8..0000000 --- a/cmd/tide/install.go +++ /dev/null @@ -1,51 +0,0 @@ -package main - -import ( - "fmt" - "io/ioutil" - "log" - "os" - - "github.com/spf13/cobra" -) - -const installDesc = ` -This command installs a chart archive. - -The install argument must be either a relative -path to a chart directory or the name of a -chart in the current working directory. -` - -var installCmd = &cobra.Command{ - Use: "install [CHART]", - Short: "install a chart archive.", - Long: installDesc, - RunE: runInstall, -} - -func runInstall(cmd *cobra.Command, args []string) error { - log.SetOutput(ioutil.Discard) - setupInstallEnv(args) - manifest, _ := readManifest(installArg) - execute("create", manifest) - return nil -} - -func setupInstallEnv(args []string) { - if len(args) > 0 { - installArg = args[0] - } else { - fatalf("This command needs at least one argument, the name of the chart.") - } -} - -func fatalf(format string, args ...interface{}) { - fmt.Printf("fatal: %s\n", fmt.Sprintf(format, args...)) - os.Exit(0) -} - -func init() { - installCmd.Flags().BoolVarP(&verbose, "verbose", "v", false, "enable verbose install") - RootCommand.AddCommand(installCmd) -} diff --git a/cmd/tide/render.go b/cmd/tide/render.go index 6748ec8..0bc44c4 100644 --- a/cmd/tide/render.go +++ b/cmd/tide/render.go @@ -17,15 +17,15 @@ chart in the current working directory. ` var renderCmd = &cobra.Command{ - Use: "render [CHART]", - Short: "render a chart archive.", + Use: "view [CHART]", + Short: "view a chart archive.", Long: renderDesc, RunE: runRender, } func runRender(cmd *cobra.Command, args []string) error { log.SetOutput(ioutil.Discard) - setupInstallEnv(args) + setupRenderEnv(args) manifest, _ := readManifest(installArg) fmt.Printf("%s\n", manifest) return nil diff --git a/cmd/tide/tide.go b/cmd/tide/tide.go index 1c6867e..20cbdfb 100644 --- a/cmd/tide/tide.go +++ b/cmd/tide/tide.go @@ -1,7 +1,9 @@ package main import ( + "fmt" "github.com/spf13/cobra" + "os" ) // install flags & args @@ -29,6 +31,11 @@ var RootCommand = &cobra.Command{ Long: globalUsage, } +func fatalf(format string, args ...interface{}) { + fmt.Printf("fatal: %s\n", fmt.Sprintf(format, args...)) + os.Exit(0) +} + func init() { RootCommand.PersistentFlags().BoolVarP(&verbose, "verbose", "v", false, "enable verbose output") } diff --git a/cmd/tide/apply.go b/cmd/tide/up.go similarity index 96% rename from cmd/tide/apply.go rename to cmd/tide/up.go index 143f49b..cedfb1e 100644 --- a/cmd/tide/apply.go +++ b/cmd/tide/up.go @@ -17,8 +17,8 @@ chart in the current working directory. ` var applyCmd = &cobra.Command{ - Use: "apply [CHART]", - Short: "apply a chart archive.", + Use: "up [CHART]", + Short: "Apply a chart archive to Kubernetes.", Long: applyDesc, RunE: runApply, }