Merge pull request #2471 from baude/clifixups

fix up a number of misplace commands
This commit is contained in:
OpenShift Merge Robot
2019-02-27 22:15:31 +01:00
committed by GitHub
5 changed files with 12 additions and 10 deletions

View File

@ -30,7 +30,6 @@ func getMainCommands() []*cobra.Command {
_rmCommand,
_runCommand,
_searchCommand,
_signCommand,
_startCommand,
_statsCommand,
_stopCommand,
@ -49,7 +48,6 @@ func getMainCommands() []*cobra.Command {
// Commands that the local client implements
func getImageSubCommands() []*cobra.Command {
return []*cobra.Command{
_loadCommand,
_signCommand,
}
}

View File

@ -14,6 +14,7 @@ var (
Long: imageDescription,
},
}
_imagesSubCommand = _imagesCommand
)
//imageSubCommands are implemented both in local and remote clients
@ -21,7 +22,6 @@ var imageSubCommands = []*cobra.Command{
_buildCommand,
_historyCommand,
_imageExistsCommand,
_imagesCommand,
_importCommand,
_inspectCommand,
_loadCommand,
@ -37,4 +37,8 @@ func init() {
imageCommand.SetUsageTemplate(UsageTemplate())
imageCommand.AddCommand(imageSubCommands...)
imageCommand.AddCommand(getImageSubCommands()...)
_imagesSubCommand.Aliases = []string{"ls", "list"}
imageCommand.AddCommand(&_imagesSubCommand)
}

View File

@ -87,7 +87,7 @@ var (
imagesCommand cliconfig.ImagesValues
imagesDescription = "lists locally stored images."
_imagesCommand = &cobra.Command{
_imagesCommand = cobra.Command{
Use: "images",
Short: "List images in local storage",
Long: imagesDescription,
@ -103,8 +103,9 @@ var (
)
func init() {
imagesCommand.Command = _imagesCommand
imagesCommand.Command = &_imagesCommand
imagesCommand.SetUsageTemplate(UsageTemplate())
flags := imagesCommand.Flags()
flags.BoolVarP(&imagesCommand.All, "all", "a", false, "Show all images (default hides intermediate images)")
flags.BoolVar(&imagesCommand.Digests, "digests", false, "Show digests")

View File

@ -38,7 +38,7 @@ var mainCommands = []*cobra.Command{
_buildCommand,
_exportCommand,
_historyCommand,
_imagesCommand,
&_imagesCommand,
_importCommand,
_infoCommand,
_inspectCommand,

View File

@ -158,10 +158,9 @@ var (
psCommand cliconfig.PsValues
psDescription = "Prints out information about the containers"
_psCommand = &cobra.Command{
Use: "list",
Aliases: []string{"ls", "ps"},
Short: "List containers",
Long: psDescription,
Use: "ps",
Short: "List containers",
Long: psDescription,
RunE: func(cmd *cobra.Command, args []string) error {
psCommand.InputArgs = args
psCommand.GlobalFlags = MainGlobalOpts