summaryrefslogtreecommitdiff
path: root/cmd/podman/image.go
blob: 6b451a1ca2408f2dd7f58c6c9ba2255e7978db23 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package main

import (
	"sort"

	"github.com/urfave/cli"
)

var (
	imageSubCommands = []cli.Command{
		importCommand,
		historyCommand,
		imageExistsCommand,
		inspectCommand,
		lsImagesCommand,
		pruneImagesCommand,
		pullCommand,
		rmImageCommand,
		tagCommand,
	}
	imageDescription = "Manage images"
	imageCommand     = cli.Command{
		Name:                   "image",
		Usage:                  "Manage images",
		Description:            imageDescription,
		ArgsUsage:              "",
		Subcommands:            getImageSubCommandsSorted(),
		UseShortOptionHandling: true,
		OnUsageError:           usageErrorHandler,
	}
)

func getImageSubCommandsSorted() []cli.Command {
	imageSubCommands = append(imageSubCommands, getImageSubCommands()...)
	sort.Sort(commandSortedAlpha{imageSubCommands})
	return imageSubCommands
}