spiegel_podman/cmd/podman/containers/list.go
Valentin Rothberg bd09b7aa79 bump go module to version 4
Automated for .go files via gomove [1]:
`gomove github.com/containers/podman/v3 github.com/containers/podman/v4`

Remaining files via vgrep [2]:
`vgrep github.com/containers/podman/v3`

[1] https://github.com/KSubedi/gomove
[2] https://github.com/vrothberg/vgrep

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2022-01-18 12:47:07 +01:00

33 lines
952 B
Go

package containers
import (
"github.com/containers/common/pkg/completion"
"github.com/containers/podman/v4/cmd/podman/registry"
"github.com/containers/podman/v4/cmd/podman/validate"
"github.com/spf13/cobra"
)
var (
// podman container _list_
listCmd = &cobra.Command{
Use: "list [options]",
Aliases: []string{"ls"},
Args: validate.NoArgs,
Short: "List containers",
Long: "Prints out information about the containers",
RunE: ps,
ValidArgsFunction: completion.AutocompleteNone,
Example: `podman container list -a
podman container list -a --format "{{.ID}} {{.Image}} {{.Labels}} {{.Mounts}}"
podman container list --size --sort names`,
}
)
func init() {
registry.Commands = append(registry.Commands, registry.CliCommand{
Command: listCmd,
Parent: containerCmd,
})
listFlagSet(listCmd)
validate.AddLatestFlag(listCmd, &listOpts.Latest)
}