-
Notifications
You must be signed in to change notification settings - Fork 212
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* 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
1 parent
2750112
commit d2c2520
Showing
33 changed files
with
395 additions
and
349 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} |
Oops, something went wrong.