fix up a number of misplace commands

* ps now on main command
* sign is no longer on main commmand
* ls, list no longer are valid main aliases for images
* ls, list does work for podman image

Signed-off-by: baude <bbaude@redhat.com>
This commit is contained in:
baude
2019-02-27 12:26:35 -06:00
parent fd16be5c00
commit 4a33ee2ab3
5 changed files with 12 additions and 10 deletions

View File

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

View File

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

View File

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

View File

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

View File

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