Skip to content

Commit

Permalink
Rename claim to instance (#547)
Browse files Browse the repository at this point in the history
* Rename claim to instance

* porter bundle list -> porter instances list
* alias porter instances list to porter list
* porter bundle outputs list -> porter instance outputs list
* porter bundle outputs show -> porter instance outputs show
* Made positional argument consistent for specifying the instance name
when listing outputs for an instance. I made it a flag since outputs
show uses a flag. Positional arguments should be used when it is the
name of the resource. In this case the resource is output, so instance
should have been a flag to begin with.
* Updated documentation to match.

* More fixes
  • Loading branch information
carolynvs-msft authored Aug 23, 2019
1 parent 2750112 commit d2c2520
Show file tree
Hide file tree
Showing 33 changed files with 395 additions and 349 deletions.
103 changes: 103 additions & 0 deletions cmd/porter/aliases.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
package main

import (
"strings"

"github.com/deislabs/porter/pkg/porter"
"github.com/spf13/cobra"
)

func buildAliasCommands(p *porter.Porter) []*cobra.Command {
return []*cobra.Command{
buildCreateAlias(p),
buildBuildAlias(p),
buildInstallAlias(p),
buildUpgradeAlias(p),
buildUninstallAlias(p),
buildInvokeAlias(p),
buildPublishAlias(p),
buildListAlias(p),
buildShowAlias(p),
}
}

func buildCreateAlias(p *porter.Porter) *cobra.Command {
cmd := buildBundleCreateCommand(p)
cmd.Example = strings.Replace(cmd.Example, "porter bundle create", "porter create", -1)
cmd.Annotations = map[string]string{
"group": "alias",
}
return cmd
}

func buildBuildAlias(p *porter.Porter) *cobra.Command {
cmd := buildBundleBuildCommand(p)
cmd.Example = strings.Replace(cmd.Example, "porter bundle build", "porter build", -1)
cmd.Annotations = map[string]string{
"group": "alias",
}
return cmd
}

func buildInstallAlias(p *porter.Porter) *cobra.Command {
cmd := buildBundleInstallCommand(p)
cmd.Example = strings.Replace(cmd.Example, "porter bundle install", "porter install", -1)
cmd.Annotations = map[string]string{
"group": "alias",
}
return cmd
}

func buildUpgradeAlias(p *porter.Porter) *cobra.Command {
cmd := buildBundleUpgradeCommand(p)
cmd.Example = strings.Replace(cmd.Example, "porter bundle upgrade", "porter upgrade", -1)
cmd.Annotations = map[string]string{
"group": "alias",
}
return cmd
}

func buildInvokeAlias(p *porter.Porter) *cobra.Command {
cmd := buildBundleInvokeCommand(p)
cmd.Example = strings.Replace(cmd.Example, "porter bundle invoke", "porter invoke", -1)
cmd.Annotations = map[string]string{
"group": "alias",
}
return cmd
}

func buildUninstallAlias(p *porter.Porter) *cobra.Command {
cmd := buildBundleUninstallCommand(p)
cmd.Example = strings.Replace(cmd.Example, "porter bundle uninstall", "porter uninstall", -1)
cmd.Annotations = map[string]string{
"group": "alias",
}
return cmd
}

func buildPublishAlias(p *porter.Porter) *cobra.Command {
cmd := buildBundlePublishCommand(p)
cmd.Example = strings.Replace(cmd.Example, "porter bundle publish", "porter publish", -1)
cmd.Annotations = map[string]string{
"group": "alias",
}
return cmd
}

func buildShowAlias(p *porter.Porter) *cobra.Command {
cmd := buildInstanceShowCommand(p)
cmd.Example = strings.Replace(cmd.Example, "porter bundle instance show", "porter show", -1)
cmd.Annotations = map[string]string{
"group": "alias",
}
return cmd
}

func buildListAlias(p *porter.Porter) *cobra.Command {
cmd := buildInstancesListCommand(p)
cmd.Example = strings.Replace(cmd.Example, "porter bundle instances list", "porter list", -1)
cmd.Annotations = map[string]string{
"group": "alias",
}
return cmd
}
Loading

0 comments on commit d2c2520

Please sign in to comment.