Fix help commands to show short and long description.

Cleanup lots of help information to look good when displayed.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
This commit is contained in:
Daniel J Walsh
2019-03-06 17:10:20 -05:00
parent 1b253cf73a
commit 9a39c60e46
75 changed files with 245 additions and 200 deletions

View File

@ -30,6 +30,7 @@ var (
func init() { func init() {
attachCommand.Command = _attachCommand attachCommand.Command = _attachCommand
attachCommand.SetHelpTemplate(HelpTemplate())
attachCommand.SetUsageTemplate(UsageTemplate()) attachCommand.SetUsageTemplate(UsageTemplate())
flags := attachCommand.Flags() flags := attachCommand.Flags()
flags.StringVar(&attachCommand.DetachKeys, "detach-keys", "", "Override the key sequence for detaching a container. Format is a single character [a-Z] or ctrl-<value> where <value> is one of: a-z, @, ^, [, , or _") flags.StringVar(&attachCommand.DetachKeys, "detach-keys", "", "Override the key sequence for detaching a container. Format is a single character [a-Z] or ctrl-<value> where <value> is one of: a-z, @, ^, [, , or _")

View File

@ -18,8 +18,7 @@ import (
var ( var (
buildCommand cliconfig.BuildValues buildCommand cliconfig.BuildValues
buildDescription = "Builds an OCI or Docker image using instructions from one\n" + buildDescription = "Builds an OCI or Docker image using instructions from one or more Dockerfiles and a specified build context directory."
"or more Dockerfiles and a specified build context directory."
layerValues buildahcli.LayerResults layerValues buildahcli.LayerResults
budFlagsValues buildahcli.BudResults budFlagsValues buildahcli.BudResults
fromAndBudValues buildahcli.FromAndBudResults fromAndBudValues buildahcli.FromAndBudResults
@ -48,6 +47,7 @@ var (
func init() { func init() {
buildCommand.Command = _buildCommand buildCommand.Command = _buildCommand
buildCommand.SetHelpTemplate(HelpTemplate())
buildCommand.SetUsageTemplate(UsageTemplate()) buildCommand.SetUsageTemplate(UsageTemplate())
flags := buildCommand.Flags() flags := buildCommand.Flags()
flags.SetInterspersed(false) flags.SetInterspersed(false)

View File

@ -40,6 +40,7 @@ var (
func init() { func init() {
checkpointCommand.Command = _checkpointCommand checkpointCommand.Command = _checkpointCommand
checkpointCommand.SetHelpTemplate(HelpTemplate())
checkpointCommand.SetUsageTemplate(UsageTemplate()) checkpointCommand.SetUsageTemplate(UsageTemplate())
flags := checkpointCommand.Flags() flags := checkpointCommand.Flags()

View File

@ -37,6 +37,7 @@ var (
func init() { func init() {
cleanupCommand.Command = _cleanupCommand cleanupCommand.Command = _cleanupCommand
cleanupCommand.SetHelpTemplate(HelpTemplate())
cleanupCommand.SetUsageTemplate(UsageTemplate()) cleanupCommand.SetUsageTemplate(UsageTemplate())
flags := cleanupCommand.Flags() flags := cleanupCommand.Flags()

View File

@ -19,10 +19,7 @@ import (
var ( var (
commitCommand cliconfig.CommitValues commitCommand cliconfig.CommitValues
commitDescription = `Create an image from a container's changes. commitDescription = `Create an image from a container's changes. Optionally tag the image created, set the author with the --author flag, set the commit message with the --message flag, and make changes to the instructions with the --change flag.`
Optionally tag the image created, set the author with the --author flag,
set the commit message with the --message flag,
and make changes to the instructions with the --change flag.`
_commitCommand = &cobra.Command{ _commitCommand = &cobra.Command{
Use: "commit [flags] CONTAINER IMAGE", Use: "commit [flags] CONTAINER IMAGE",
@ -41,6 +38,7 @@ var (
func init() { func init() {
commitCommand.Command = _commitCommand commitCommand.Command = _commitCommand
commitCommand.SetHelpTemplate(HelpTemplate())
commitCommand.SetUsageTemplate(UsageTemplate()) commitCommand.SetUsageTemplate(UsageTemplate())
flags := commitCommand.Flags() flags := commitCommand.Flags()
flags.StringSliceVarP(&commitCommand.Change, "change", "c", []string{}, fmt.Sprintf("Apply the following possible instructions to the created image (default []): %s", strings.Join(libpod.ChangeCmds, " | "))) flags.StringSliceVarP(&commitCommand.Change, "change", "c", []string{}, fmt.Sprintf("Apply the following possible instructions to the created image (default []): %s", strings.Join(libpod.ChangeCmds, " | ")))

View File

@ -521,6 +521,18 @@ func scrubServer(server string) string {
return strings.TrimPrefix(server, "http://") return strings.TrimPrefix(server, "http://")
} }
// HelpTemplate returns the help template for podman commands
// This uses the short and long options.
// command should not use this.
func HelpTemplate() string {
return `{{.Short}}
Description:
{{.Long}}
{{if or .Runnable .HasSubCommands}}{{.UsageString}}{{end}}`
}
// UsageTemplate returns the usage template for podman commands // UsageTemplate returns the usage template for podman commands
// This blocks the desplaying of the global options. The main podman // This blocks the desplaying of the global options. The main podman
// command should not use this. // command should not use this.

View File

@ -34,6 +34,7 @@ var (
func init() { func init() {
pruneContainersCommand.Command = _pruneContainersCommand pruneContainersCommand.Command = _pruneContainersCommand
pruneContainersCommand.SetHelpTemplate(HelpTemplate())
pruneContainersCommand.SetUsageTemplate(UsageTemplate()) pruneContainersCommand.SetUsageTemplate(UsageTemplate())
flags := pruneContainersCommand.Flags() flags := pruneContainersCommand.Flags()
flags.BoolVarP(&pruneContainersCommand.Force, "force", "f", false, "Force removal of a running container. The default is false") flags.BoolVarP(&pruneContainersCommand.Force, "force", "f", false, "Force removal of a running container. The default is false")

View File

@ -27,8 +27,11 @@ import (
var ( var (
cpCommand cliconfig.CpValues cpCommand cliconfig.CpValues
cpDescription = "Copy files/folders between a container and the local filesystem" cpDescription = `Command copies the contents of SRC_PATH to the DEST_PATH.
_cpCommand = &cobra.Command{
You can copy from the container's file system to the local machine or the reverse, from the local filesystem to the container. If "-" is specified for either the SRC_PATH or DEST_PATH, you can also stream a tar archive from STDIN or to STDOUT. The CONTAINER can be a running or stopped container. The SRC_PATH or DEST_PATH can be a file or directory.
`
_cpCommand = &cobra.Command{
Use: "cp [flags] SRC_PATH DEST_PATH", Use: "cp [flags] SRC_PATH DEST_PATH",
Short: "Copy files/folders between a container and the local filesystem", Short: "Copy files/folders between a container and the local filesystem",
Long: cpDescription, Long: cpDescription,
@ -45,6 +48,8 @@ func init() {
cpCommand.Command = _cpCommand cpCommand.Command = _cpCommand
flags := cpCommand.Flags() flags := cpCommand.Flags()
flags.BoolVar(&cpCommand.Extract, "extract", false, "Extract the tar file into the destination directory.") flags.BoolVar(&cpCommand.Extract, "extract", false, "Extract the tar file into the destination directory.")
cpCommand.SetHelpTemplate(HelpTemplate())
cpCommand.SetUsageTemplate(UsageTemplate())
rootCmd.AddCommand(cpCommand.Command) rootCmd.AddCommand(cpCommand.Command)
} }

View File

@ -37,11 +37,9 @@ import (
var ( var (
createCommand cliconfig.CreateValues createCommand cliconfig.CreateValues
createDescription = "Creates a new container from the given image or" + createDescription = `Creates a new container from the given image or storage and prepares it for running the specified command.
" storage and prepares it for running the specified command. The" +
" container ID is then printed to stdout. You can then start it at" + The container ID is then printed to stdout. You can then start it at any time with the podman start <container_id> command. The container will be created with the initial state 'created'.`
" any time with the podman start <container_id> command. The container" +
" will be created with the initial state 'created'."
_createCommand = &cobra.Command{ _createCommand = &cobra.Command{
Use: "create [flags] IMAGE [COMMAND [ARG...]]", Use: "create [flags] IMAGE [COMMAND [ARG...]]",
Short: "Create but do not start a container", Short: "Create but do not start a container",
@ -64,6 +62,7 @@ var (
func init() { func init() {
createCommand.PodmanCommand.Command = _createCommand createCommand.PodmanCommand.Command = _createCommand
createCommand.SetHelpTemplate(HelpTemplate())
createCommand.SetUsageTemplate(UsageTemplate()) createCommand.SetUsageTemplate(UsageTemplate())
getCreateFlags(&createCommand.PodmanCommand) getCreateFlags(&createCommand.PodmanCommand)

View File

@ -34,8 +34,7 @@ func (so stdoutStruct) Out() error {
var ( var (
diffCommand cliconfig.DiffValues diffCommand cliconfig.DiffValues
diffDescription = fmt.Sprint(`Displays changes on a container or image's filesystem. The diffDescription = fmt.Sprint(`Displays changes on a container or image's filesystem. The container or image will be compared to its parent layer.`)
container or image will be compared to its parent layer`)
_diffCommand = &cobra.Command{ _diffCommand = &cobra.Command{
Use: "diff [flags] CONTAINER | IMAGE", Use: "diff [flags] CONTAINER | IMAGE",
@ -54,6 +53,7 @@ var (
func init() { func init() {
diffCommand.Command = _diffCommand diffCommand.Command = _diffCommand
diffCommand.SetHelpTemplate(HelpTemplate())
diffCommand.SetUsageTemplate(UsageTemplate()) diffCommand.SetUsageTemplate(UsageTemplate())
flags := diffCommand.Flags() flags := diffCommand.Flags()

View File

@ -17,10 +17,7 @@ import (
var ( var (
execCommand cliconfig.ExecValues execCommand cliconfig.ExecValues
execDescription = ` execDescription = `Execute the specified command inside a running container.
podman exec
Run a command in a running container
` `
_execCommand = &cobra.Command{ _execCommand = &cobra.Command{
Use: "exec [flags] CONTAINER [COMMAND [ARG...]]", Use: "exec [flags] CONTAINER [COMMAND [ARG...]]",
@ -39,6 +36,7 @@ var (
func init() { func init() {
execCommand.Command = _execCommand execCommand.Command = _execCommand
execCommand.SetHelpTemplate(HelpTemplate())
execCommand.SetUsageTemplate(UsageTemplate()) execCommand.SetUsageTemplate(UsageTemplate())
flags := execCommand.Flags() flags := execCommand.Flags()
flags.SetInterspersed(false) flags.SetInterspersed(false)

View File

@ -16,21 +16,12 @@ var (
containerExistsCommand cliconfig.ContainerExistsValues containerExistsCommand cliconfig.ContainerExistsValues
podExistsCommand cliconfig.PodExistsValues podExistsCommand cliconfig.PodExistsValues
imageExistsDescription = ` imageExistsDescription = `If the named image exists in local storage, podman image exists exits with 0, otherwise the exit code will be 1.`
podman image exists
Check if an image exists in local storage containerExistsDescription = `If the named container exists in local storage, podman container exists exits with 0, otherwise the exit code will be 1.`
`
containerExistsDescription = `
podman container exists
Check if a container exists in local storage podExistsDescription = `If the named pod exists in local storage, podman pod exists exits with 0, otherwise the exit code will be 1.`
`
podExistsDescription = `
podman pod exists
Check if a pod exists in local storage
`
_imageExistsCommand = &cobra.Command{ _imageExistsCommand = &cobra.Command{
Use: "exists IMAGE", Use: "exists IMAGE",
Short: "Check if an image exists in local storage", Short: "Check if an image exists in local storage",
@ -75,12 +66,15 @@ var (
func init() { func init() {
imageExistsCommand.Command = _imageExistsCommand imageExistsCommand.Command = _imageExistsCommand
imageExistsCommand.DisableFlagsInUseLine = true imageExistsCommand.DisableFlagsInUseLine = true
imageExistsCommand.SetHelpTemplate(HelpTemplate())
imageExistsCommand.SetUsageTemplate(UsageTemplate()) imageExistsCommand.SetUsageTemplate(UsageTemplate())
containerExistsCommand.Command = _containerExistsCommand containerExistsCommand.Command = _containerExistsCommand
containerExistsCommand.DisableFlagsInUseLine = true containerExistsCommand.DisableFlagsInUseLine = true
containerExistsCommand.SetHelpTemplate(HelpTemplate())
containerExistsCommand.SetUsageTemplate(UsageTemplate()) containerExistsCommand.SetUsageTemplate(UsageTemplate())
podExistsCommand.Command = _podExistsCommand podExistsCommand.Command = _podExistsCommand
podExistsCommand.DisableFlagsInUseLine = true podExistsCommand.DisableFlagsInUseLine = true
podExistsCommand.SetHelpTemplate(HelpTemplate())
podExistsCommand.SetUsageTemplate(UsageTemplate()) podExistsCommand.SetUsageTemplate(UsageTemplate())
} }

View File

@ -32,6 +32,7 @@ var (
func init() { func init() {
exportCommand.Command = _exportCommand exportCommand.Command = _exportCommand
exportCommand.SetHelpTemplate(HelpTemplate())
exportCommand.SetUsageTemplate(UsageTemplate()) exportCommand.SetUsageTemplate(UsageTemplate())
flags := exportCommand.Flags() flags := exportCommand.Flags()
flags.StringVarP(&exportCommand.Output, "output", "o", "/dev/stdout", "Write to a file, default is STDOUT") flags.StringVarP(&exportCommand.Output, "output", "o", "/dev/stdout", "Write to a file, default is STDOUT")

View File

@ -15,10 +15,12 @@ import (
var ( var (
containerKubeCommand cliconfig.GenerateKubeValues containerKubeCommand cliconfig.GenerateKubeValues
containerKubeDescription = "Generate Kubernetes Pod YAML" containerKubeDescription = `Command generates Kubernetes Pod YAML (v1 specification) from a podman container or pod.
_containerKubeCommand = &cobra.Command{
Whether the input is for a container or pod, Podman will always generate the specification as a Pod. The input may be in the form of a pod or container name or ID.`
_containerKubeCommand = &cobra.Command{
Use: "kube [flags] CONTAINER | POD", Use: "kube [flags] CONTAINER | POD",
Short: "Generate Kubernetes pod YAML for a container or pod", Short: "Generate Kubernetes pod YAML from a container or pod",
Long: containerKubeDescription, Long: containerKubeDescription,
RunE: func(cmd *cobra.Command, args []string) error { RunE: func(cmd *cobra.Command, args []string) error {
containerKubeCommand.InputArgs = args containerKubeCommand.InputArgs = args
@ -33,6 +35,7 @@ var (
func init() { func init() {
containerKubeCommand.Command = _containerKubeCommand containerKubeCommand.Command = _containerKubeCommand
containerKubeCommand.SetHelpTemplate(HelpTemplate())
containerKubeCommand.SetUsageTemplate(UsageTemplate()) containerKubeCommand.SetUsageTemplate(UsageTemplate())
flags := containerKubeCommand.Flags() flags := containerKubeCommand.Flags()
flags.BoolVarP(&containerKubeCommand.Service, "service", "s", false, "Generate YAML for kubernetes service object") flags.BoolVarP(&containerKubeCommand.Service, "service", "s", false, "Generate YAML for kubernetes service object")

View File

@ -37,8 +37,9 @@ type historyOptions struct {
var ( var (
historyCommand cliconfig.HistoryValues historyCommand cliconfig.HistoryValues
historyDescription = "Displays the history of an image. The information can be printed out in an easy to read, " + historyDescription = `Displays the history of an image.
"or user specified format, and can be truncated."
The information can be printed out in an easy to read, or user specified format, and can be truncated.`
_historyCommand = &cobra.Command{ _historyCommand = &cobra.Command{
Use: "history [flags] IMAGE", Use: "history [flags] IMAGE",
Short: "Show history of a specified image", Short: "Show history of a specified image",
@ -53,6 +54,7 @@ var (
func init() { func init() {
historyCommand.Command = _historyCommand historyCommand.Command = _historyCommand
historyCommand.SetHelpTemplate(HelpTemplate())
historyCommand.SetUsageTemplate(UsageTemplate()) historyCommand.SetUsageTemplate(UsageTemplate())
flags := historyCommand.Flags() flags := historyCommand.Flags()
flags.StringVar(&historyCommand.Format, "format", "", "Change the output to JSON or a Go template") flags.StringVar(&historyCommand.Format, "format", "", "Change the output to JSON or a Go template")

View File

@ -85,7 +85,7 @@ func (a imagesSortedSize) Less(i, j int) bool {
var ( var (
imagesCommand cliconfig.ImagesValues imagesCommand cliconfig.ImagesValues
imagesDescription = "lists locally stored images." imagesDescription = "Lists images previously pulled to the system or created on the system."
_imagesCommand = cobra.Command{ _imagesCommand = cobra.Command{
Use: "images [flags] [IMAGE]", Use: "images [flags] [IMAGE]",
@ -103,6 +103,7 @@ var (
) )
func imagesInit(command *cliconfig.ImagesValues) { func imagesInit(command *cliconfig.ImagesValues) {
command.SetHelpTemplate(HelpTemplate())
command.SetUsageTemplate(UsageTemplate()) command.SetUsageTemplate(UsageTemplate())
flags := command.Flags() flags := command.Flags()

View File

@ -11,11 +11,9 @@ import (
var ( var (
pruneImagesCommand cliconfig.PruneImagesValues pruneImagesCommand cliconfig.PruneImagesValues
pruneImagesDescription = ` pruneImagesDescription = `Removes all unnamed images from local storage.
podman image prune
Removes all unnamed images from local storage If an image is not being used by a container, it will be removed from the system.`
`
_pruneImagesCommand = &cobra.Command{ _pruneImagesCommand = &cobra.Command{
Use: "prune", Use: "prune",
Args: noSubArgs, Args: noSubArgs,
@ -31,6 +29,7 @@ var (
func init() { func init() {
pruneImagesCommand.Command = _pruneImagesCommand pruneImagesCommand.Command = _pruneImagesCommand
pruneImagesCommand.SetHelpTemplate(HelpTemplate())
pruneImagesCommand.SetUsageTemplate(UsageTemplate()) pruneImagesCommand.SetUsageTemplate(UsageTemplate())
flags := pruneImagesCommand.Flags() flags := pruneImagesCommand.Flags()
flags.BoolVarP(&pruneImagesCommand.All, "all", "a", false, "Remove all unused images, not just dangling ones") flags.BoolVarP(&pruneImagesCommand.All, "all", "a", false, "Remove all unused images, not just dangling ones")

View File

@ -13,9 +13,9 @@ var (
importCommand cliconfig.ImportValues importCommand cliconfig.ImportValues
importDescription = `Create a container image from the contents of the specified tarball (.tar, .tar.gz, .tgz, .bzip, .tar.xz, .txz). importDescription = `Create a container image from the contents of the specified tarball (.tar, .tar.gz, .tgz, .bzip, .tar.xz, .txz).
Note remote tar balls can be specified, via web address.
Optionally tag the image. You can specify the instructions using the --change option. Note remote tar balls can be specified, via web address.
` Optionally tag the image. You can specify the instructions using the --change option.`
_importCommand = &cobra.Command{ _importCommand = &cobra.Command{
Use: "import [flags] PATH [REFERENCE]", Use: "import [flags] PATH [REFERENCE]",
Short: "Import a tarball to create a filesystem image", Short: "Import a tarball to create a filesystem image",
@ -33,6 +33,7 @@ var (
func init() { func init() {
importCommand.Command = _importCommand importCommand.Command = _importCommand
importCommand.SetHelpTemplate(HelpTemplate())
importCommand.SetUsageTemplate(UsageTemplate()) importCommand.SetUsageTemplate(UsageTemplate())
flags := importCommand.Flags() flags := importCommand.Flags()
flags.StringSliceVarP(&importCommand.Change, "change", "c", []string{}, "Apply the following possible instructions to the created image (default []): CMD | ENTRYPOINT | ENV | EXPOSE | LABEL | STOPSIGNAL | USER | VOLUME | WORKDIR") flags.StringSliceVarP(&importCommand.Change, "change", "c", []string{}, "Apply the following possible instructions to the created image (default []): CMD | ENTRYPOINT | ENV | EXPOSE | LABEL | STOPSIGNAL | USER | VOLUME | WORKDIR")

View File

@ -16,12 +16,15 @@ import (
var ( var (
infoCommand cliconfig.InfoValues infoCommand cliconfig.InfoValues
infoDescription = "Display podman system information" infoDescription = `Display information pertaining to the host, current storage stats, and build of podman.
_infoCommand = &cobra.Command{
Useful for the user and when reporting issues.
`
_infoCommand = &cobra.Command{
Use: "info", Use: "info",
Args: noSubArgs, Args: noSubArgs,
Long: infoDescription, Long: infoDescription,
Short: `Display information pertaining to the host, current storage stats, and build of podman. Useful for the user and when reporting issues.`, Short: "Display podman system information",
RunE: func(cmd *cobra.Command, args []string) error { RunE: func(cmd *cobra.Command, args []string) error {
infoCommand.InputArgs = args infoCommand.InputArgs = args
infoCommand.GlobalFlags = MainGlobalOpts infoCommand.GlobalFlags = MainGlobalOpts
@ -33,6 +36,7 @@ var (
func init() { func init() {
infoCommand.Command = _infoCommand infoCommand.Command = _infoCommand
infoCommand.SetHelpTemplate(HelpTemplate())
infoCommand.SetUsageTemplate(UsageTemplate()) infoCommand.SetUsageTemplate(UsageTemplate())
flags := infoCommand.Flags() flags := infoCommand.Flags()

View File

@ -24,8 +24,10 @@ const (
var ( var (
inspectCommand cliconfig.InspectValues inspectCommand cliconfig.InspectValues
inspectDescription = "This displays the low-level information on containers and images identified by name or ID. By default, this will render all results in a JSON array. If the container and image have the same name, this will return container JSON for unspecified type." inspectDescription = `This displays the low-level information on containers and images identified by name or ID.
_inspectCommand = &cobra.Command{
If given a name that matches both a container and an image, this command inspects the container. By default, this will render all results in a JSON array.`
_inspectCommand = &cobra.Command{
Use: "inspect [flags] CONTAINER | IMAGE", Use: "inspect [flags] CONTAINER | IMAGE",
Short: "Display the configuration of a container or image", Short: "Display the configuration of a container or image",
Long: inspectDescription, Long: inspectDescription,
@ -42,6 +44,7 @@ var (
func init() { func init() {
inspectCommand.Command = _inspectCommand inspectCommand.Command = _inspectCommand
inspectCommand.SetHelpTemplate(HelpTemplate())
inspectCommand.SetUsageTemplate(UsageTemplate()) inspectCommand.SetUsageTemplate(UsageTemplate())
flags := inspectCommand.Flags() flags := inspectCommand.Flags()
flags.StringVarP(&inspectCommand.TypeObject, "type", "t", inspectAll, "Return JSON for specified type, (e.g image, container or task)") flags.StringVarP(&inspectCommand.TypeObject, "type", "t", inspectAll, "Return JSON for specified type, (e.g image, container or task)")

View File

@ -38,6 +38,7 @@ var (
func init() { func init() {
killCommand.Command = _killCommand killCommand.Command = _killCommand
killCommand.SetHelpTemplate(HelpTemplate())
killCommand.SetUsageTemplate(UsageTemplate()) killCommand.SetUsageTemplate(UsageTemplate())
flags := killCommand.Flags() flags := killCommand.Flags()

View File

@ -30,6 +30,7 @@ var (
func init() { func init() {
loadCommand.Command = _loadCommand loadCommand.Command = _loadCommand
loadCommand.SetHelpTemplate(HelpTemplate())
loadCommand.SetUsageTemplate(UsageTemplate()) loadCommand.SetUsageTemplate(UsageTemplate())
flags := loadCommand.Flags() flags := loadCommand.Flags()
flags.StringVarP(&loadCommand.Input, "input", "i", "/dev/stdin", "Read from archive file, default is STDIN") flags.StringVarP(&loadCommand.Input, "input", "i", "/dev/stdin", "Read from archive file, default is STDIN")

View File

@ -37,6 +37,7 @@ var (
func init() { func init() {
loginCommand.Command = _loginCommand loginCommand.Command = _loginCommand
loginCommand.SetHelpTemplate(HelpTemplate())
loginCommand.SetUsageTemplate(UsageTemplate()) loginCommand.SetUsageTemplate(UsageTemplate())
flags := loginCommand.Flags() flags := loginCommand.Flags()

View File

@ -30,6 +30,7 @@ var (
func init() { func init() {
logoutCommand.Command = _logoutCommand logoutCommand.Command = _logoutCommand
logoutCommand.SetHelpTemplate(HelpTemplate())
logoutCommand.SetUsageTemplate(UsageTemplate()) logoutCommand.SetUsageTemplate(UsageTemplate())
flags := logoutCommand.Flags() flags := logoutCommand.Flags()
flags.BoolVarP(&logoutCommand.All, "all", "a", false, "Remove the cached credentials for all registries in the auth file") flags.BoolVarP(&logoutCommand.All, "all", "a", false, "Remove the cached credentials for all registries in the auth file")

View File

@ -15,8 +15,10 @@ import (
var ( var (
logsCommand cliconfig.LogsValues logsCommand cliconfig.LogsValues
logsDescription = "The podman logs command batch-retrieves whatever logs are present for a container at the time of execution. This does not guarantee execution" + logsDescription = `Retrieves logs for a container.
"order when combined with podman run (i.e. your run may not have generated any logs at the time you execute podman logs"
This does not guarantee execution order when combined with podman run (i.e. your run may not have generated any logs at the time you execute podman logs.
`
_logsCommand = &cobra.Command{ _logsCommand = &cobra.Command{
Use: "logs [flags] CONTAINER", Use: "logs [flags] CONTAINER",
Short: "Fetch the logs of a container", Short: "Fetch the logs of a container",
@ -34,6 +36,7 @@ var (
func init() { func init() {
logsCommand.Command = _logsCommand logsCommand.Command = _logsCommand
logsCommand.SetHelpTemplate(HelpTemplate())
logsCommand.SetUsageTemplate(UsageTemplate()) logsCommand.SetUsageTemplate(UsageTemplate())
flags := logsCommand.Flags() flags := logsCommand.Flags()
flags.BoolVar(&logsCommand.Details, "details", false, "Show extra details provided to the logs") flags.BoolVar(&logsCommand.Details, "details", false, "Show extra details provided to the logs")

View File

@ -17,12 +17,11 @@ import (
var ( var (
mountCommand cliconfig.MountValues mountCommand cliconfig.MountValues
mountDescription = ` mountDescription = `podman mount
podman mount Lists all mounted containers mount points if no container is specified
Lists all mounted containers mount points
podman mount CONTAINER-NAME-OR-ID podman mount CONTAINER-NAME-OR-ID
Mounts the specified container and outputs the mountpoint Mounts the specified container and outputs the mountpoint
` `
_mountCommand = &cobra.Command{ _mountCommand = &cobra.Command{
@ -42,6 +41,7 @@ var (
func init() { func init() {
mountCommand.Command = _mountCommand mountCommand.Command = _mountCommand
mountCommand.SetHelpTemplate(HelpTemplate())
mountCommand.SetUsageTemplate(UsageTemplate()) mountCommand.SetUsageTemplate(UsageTemplate())
flags := mountCommand.Flags() flags := mountCommand.Flags()
flags.BoolVarP(&mountCommand.All, "all", "a", false, "Mount all containers") flags.BoolVarP(&mountCommand.All, "all", "a", false, "Mount all containers")

View File

@ -14,12 +14,8 @@ import (
var ( var (
pauseCommand cliconfig.PauseValues pauseCommand cliconfig.PauseValues
pauseDescription = ` pauseDescription = `Pauses one or more running containers. The container name or ID can be used.`
podman pause _pauseCommand = &cobra.Command{
Pauses one or more running containers. The container name or ID can be used.
`
_pauseCommand = &cobra.Command{
Use: "pause [flags] CONTAINER [CONTAINER...]", Use: "pause [flags] CONTAINER [CONTAINER...]",
Short: "Pause all the processes in one or more containers", Short: "Pause all the processes in one or more containers",
Long: pauseDescription, Long: pauseDescription,
@ -36,6 +32,7 @@ var (
func init() { func init() {
pauseCommand.Command = _pauseCommand pauseCommand.Command = _pauseCommand
pauseCommand.SetHelpTemplate(HelpTemplate())
pauseCommand.SetUsageTemplate(UsageTemplate()) pauseCommand.SetUsageTemplate(UsageTemplate())
flags := pauseCommand.Flags() flags := pauseCommand.Flags()
flags.BoolVarP(&pauseCommand.All, "all", "a", false, "Pause all running containers") flags.BoolVarP(&pauseCommand.All, "all", "a", false, "Pause all running containers")

View File

@ -17,6 +17,7 @@ var (
func init() { func init() {
playCommand.Command = _playCommand playCommand.Command = _playCommand
playCommand.SetHelpTemplate(HelpTemplate())
playCommand.SetUsageTemplate(UsageTemplate()) playCommand.SetUsageTemplate(UsageTemplate())
playCommand.AddCommand(getPlaySubCommands()...) playCommand.AddCommand(getPlaySubCommands()...)
} }

View File

@ -32,8 +32,10 @@ const (
var ( var (
playKubeCommand cliconfig.KubePlayValues playKubeCommand cliconfig.KubePlayValues
playKubeDescription = "Play a Pod and its containers based on a Kubrernetes YAML" playKubeDescription = `Command reads in a structured file of Kubernetes YAML.
_playKubeCommand = &cobra.Command{
It creates the pod and containers described in the YAML. The containers within the pod are then started and the ID of the new Pod is output.`
_playKubeCommand = &cobra.Command{
Use: "kube [flags] KUBEFILE", Use: "kube [flags] KUBEFILE",
Short: "Play a pod based on Kubernetes YAML", Short: "Play a pod based on Kubernetes YAML",
Long: playKubeDescription, Long: playKubeDescription,
@ -49,6 +51,7 @@ var (
func init() { func init() {
playKubeCommand.Command = _playKubeCommand playKubeCommand.Command = _playKubeCommand
playKubeCommand.SetHelpTemplate(HelpTemplate())
playKubeCommand.SetUsageTemplate(UsageTemplate()) playKubeCommand.SetUsageTemplate(UsageTemplate())
flags := playKubeCommand.Flags() flags := playKubeCommand.Flags()
flags.StringVar(&playKubeCommand.Authfile, "authfile", "", "Path of the authentication file. Default is ${XDG_RUNTIME_DIR}/containers/auth.json. Use REGISTRY_AUTH_FILE environment variable to override") flags.StringVar(&playKubeCommand.Authfile, "authfile", "", "Path of the authentication file. Default is ${XDG_RUNTIME_DIR}/containers/auth.json. Use REGISTRY_AUTH_FILE environment variable to override")

View File

@ -6,9 +6,7 @@ import (
) )
var ( var (
podDescription = `Manage container pods. podDescription = `Pods are a group of one or more containers sharing the same network, pid and ipc namespaces.`
Pods are a group of one or more containers sharing the same network, pid and ipc namespaces.`
) )
var podCommand = cliconfig.PodmanCommand{ var podCommand = cliconfig.PodmanCommand{
Command: &cobra.Command{ Command: &cobra.Command{
@ -37,5 +35,6 @@ var podSubCommands = []*cobra.Command{
func init() { func init() {
podCommand.AddCommand(podSubCommands...) podCommand.AddCommand(podSubCommands...)
podCommand.SetHelpTemplate(HelpTemplate())
podCommand.SetUsageTemplate(UsageTemplate()) podCommand.SetUsageTemplate(UsageTemplate())
} }

View File

@ -17,10 +17,9 @@ var (
DefaultKernelNamespaces = "cgroup,ipc,net,uts" DefaultKernelNamespaces = "cgroup,ipc,net,uts"
podCreateCommand cliconfig.PodCreateValues podCreateCommand cliconfig.PodCreateValues
podCreateDescription = "Creates a new empty pod. The pod ID is then" + podCreateDescription = `After creating the pod, the pod ID is printed to stdout.
" printed to stdout. You can then start it at any time with the" +
" podman pod start <pod_id> command. The pod will be created with the" + You can then start it at any time with the podman pod start <pod_id> command. The pod will be created with the initial state 'created'.`
" initial state 'created'."
_podCreateCommand = &cobra.Command{ _podCreateCommand = &cobra.Command{
Use: "create", Use: "create",
@ -37,6 +36,7 @@ var (
func init() { func init() {
podCreateCommand.Command = _podCreateCommand podCreateCommand.Command = _podCreateCommand
podCreateCommand.SetHelpTemplate(HelpTemplate())
podCreateCommand.SetUsageTemplate(UsageTemplate()) podCreateCommand.SetUsageTemplate(UsageTemplate())
flags := podCreateCommand.Flags() flags := podCreateCommand.Flags()
flags.SetInterspersed(false) flags.SetInterspersed(false)

View File

@ -12,8 +12,11 @@ import (
var ( var (
podInspectCommand cliconfig.PodInspectValues podInspectCommand cliconfig.PodInspectValues
podInspectDescription = "Display the configuration for a pod by name or id" podInspectDescription = `Display the configuration for a pod by name or id
_podInspectCommand = &cobra.Command{
By default, this will render all results in a JSON array. If the container and image have the same name, this command returns the container JSON.`
_podInspectCommand = &cobra.Command{
Use: "inspect [flags] POD", Use: "inspect [flags] POD",
Short: "Displays a pod configuration", Short: "Displays a pod configuration",
Long: podInspectDescription, Long: podInspectDescription,
@ -28,6 +31,7 @@ var (
func init() { func init() {
podInspectCommand.Command = _podInspectCommand podInspectCommand.Command = _podInspectCommand
podInspectCommand.SetHelpTemplate(HelpTemplate())
podInspectCommand.SetUsageTemplate(UsageTemplate()) podInspectCommand.SetUsageTemplate(UsageTemplate())
flags := podInspectCommand.Flags() flags := podInspectCommand.Flags()
flags.BoolVarP(&podInspectCommand.Latest, "latest", "l", false, "Act on the latest container podman is aware of") flags.BoolVarP(&podInspectCommand.Latest, "latest", "l", false, "Act on the latest container podman is aware of")

View File

@ -14,8 +14,10 @@ import (
var ( var (
podKillCommand cliconfig.PodKillValues podKillCommand cliconfig.PodKillValues
podKillDescription = "The main process of each container inside the specified pod will be sent SIGKILL, or any signal specified with option --signal." podKillDescription = `Signals are sent to the main process of each container inside the specified pod.
_podKillCommand = &cobra.Command{
The default signal is SIGKILL, or any signal specified with option --signal.`
_podKillCommand = &cobra.Command{
Use: "kill [flags] POD [POD...]", Use: "kill [flags] POD [POD...]",
Short: "Send the specified signal or SIGKILL to containers in pod", Short: "Send the specified signal or SIGKILL to containers in pod",
Long: podKillDescription, Long: podKillDescription,
@ -35,6 +37,7 @@ var (
func init() { func init() {
podKillCommand.Command = _podKillCommand podKillCommand.Command = _podKillCommand
podKillCommand.SetHelpTemplate(HelpTemplate())
podKillCommand.SetUsageTemplate(UsageTemplate()) podKillCommand.SetUsageTemplate(UsageTemplate())
flags := podKillCommand.Flags() flags := podKillCommand.Flags()
flags.BoolVarP(&podKillCommand.All, "all", "a", false, "Kill all containers in all pods") flags.BoolVarP(&podKillCommand.All, "all", "a", false, "Kill all containers in all pods")

View File

@ -11,8 +11,10 @@ import (
var ( var (
podPauseCommand cliconfig.PodPauseValues podPauseCommand cliconfig.PodPauseValues
podPauseDescription = `Pauses one or more pods. The pod name or ID can be used.` podPauseDescription = `The pod name or ID can be used.
_podPauseCommand = &cobra.Command{
All running containers within each specified pod will then be paused.`
_podPauseCommand = &cobra.Command{
Use: "pause [flags] POD [POD...]", Use: "pause [flags] POD [POD...]",
Short: "Pause one or more pods", Short: "Pause one or more pods",
Long: podPauseDescription, Long: podPauseDescription,
@ -32,6 +34,7 @@ var (
func init() { func init() {
podPauseCommand.Command = _podPauseCommand podPauseCommand.Command = _podPauseCommand
podPauseCommand.SetHelpTemplate(HelpTemplate())
podPauseCommand.SetUsageTemplate(UsageTemplate()) podPauseCommand.SetUsageTemplate(UsageTemplate())
flags := podPauseCommand.Flags() flags := podPauseCommand.Flags()
flags.BoolVarP(&podPauseCommand.All, "all", "a", false, "Pause all running pods") flags.BoolVarP(&podPauseCommand.All, "all", "a", false, "Pause all running pods")

View File

@ -134,6 +134,7 @@ var (
func init() { func init() {
podPsCommand.Command = _podPsCommand podPsCommand.Command = _podPsCommand
podPsCommand.SetHelpTemplate(HelpTemplate())
podPsCommand.SetUsageTemplate(UsageTemplate()) podPsCommand.SetUsageTemplate(UsageTemplate())
flags := podPsCommand.Flags() flags := podPsCommand.Flags()
flags.BoolVar(&podPsCommand.CtrNames, "ctr-names", false, "Display the container names") flags.BoolVar(&podPsCommand.CtrNames, "ctr-names", false, "Display the container names")

View File

@ -12,8 +12,10 @@ import (
var ( var (
podRestartCommand cliconfig.PodRestartValues podRestartCommand cliconfig.PodRestartValues
podRestartDescription = `Restarts one or more pods. The pod ID or name can be used.` podRestartDescription = `The pod ID or name can be used.
_podRestartCommand = &cobra.Command{
All of the containers within each of the specified pods will be restarted. If a container in a pod is not currently running it will be started.`
_podRestartCommand = &cobra.Command{
Use: "restart [flags] POD [POD...]", Use: "restart [flags] POD [POD...]",
Short: "Restart one or more pods", Short: "Restart one or more pods",
Long: podRestartDescription, Long: podRestartDescription,
@ -33,6 +35,7 @@ var (
func init() { func init() {
podRestartCommand.Command = _podRestartCommand podRestartCommand.Command = _podRestartCommand
podRestartCommand.SetHelpTemplate(HelpTemplate())
podRestartCommand.SetUsageTemplate(UsageTemplate()) podRestartCommand.SetUsageTemplate(UsageTemplate())
flags := podRestartCommand.Flags() flags := podRestartCommand.Flags()
flags.BoolVarP(&podRestartCommand.All, "all", "a", false, "Restart all running pods") flags.BoolVarP(&podRestartCommand.All, "all", "a", false, "Restart all running pods")

View File

@ -12,11 +12,9 @@ import (
var ( var (
podRmCommand cliconfig.PodRmValues podRmCommand cliconfig.PodRmValues
podRmDescription = fmt.Sprintf(` podRmDescription = fmt.Sprintf(`podman rm will remove one or more pods from the host.
podman rm will remove one or more pods from the host. The pod name or ID can
be used. A pod with containers will not be removed without --force. The pod name or ID can be used. A pod with containers will not be removed without --force. If --force is specified, all containers will be stopped, then removed.`)
If --force is specified, all containers will be stopped, then removed.
`)
_podRmCommand = &cobra.Command{ _podRmCommand = &cobra.Command{
Use: "rm [flags] POD [POD...]", Use: "rm [flags] POD [POD...]",
Short: "Remove one or more pods", Short: "Remove one or more pods",
@ -37,6 +35,7 @@ If --force is specified, all containers will be stopped, then removed.
func init() { func init() {
podRmCommand.Command = _podRmCommand podRmCommand.Command = _podRmCommand
podRmCommand.SetHelpTemplate(HelpTemplate())
podRmCommand.SetUsageTemplate(UsageTemplate()) podRmCommand.SetUsageTemplate(UsageTemplate())
flags := podRmCommand.Flags() flags := podRmCommand.Flags()
flags.BoolVarP(&podRmCommand.All, "all", "a", false, "Remove all running pods") flags.BoolVarP(&podRmCommand.All, "all", "a", false, "Remove all running pods")

View File

@ -12,11 +12,9 @@ import (
var ( var (
podStartCommand cliconfig.PodStartValues podStartCommand cliconfig.PodStartValues
podStartDescription = ` podStartDescription = `The pod name or ID can be used.
podman pod start
Starts one or more pods. The pod name or ID can be used. All containers defined in the pod will be started.`
`
_podStartCommand = &cobra.Command{ _podStartCommand = &cobra.Command{
Use: "start [flags] POD [POD...]", Use: "start [flags] POD [POD...]",
Short: "Start one or more pods", Short: "Start one or more pods",
@ -37,6 +35,7 @@ var (
func init() { func init() {
podStartCommand.Command = _podStartCommand podStartCommand.Command = _podStartCommand
podStartCommand.SetHelpTemplate(HelpTemplate())
podStartCommand.SetUsageTemplate(UsageTemplate()) podStartCommand.SetUsageTemplate(UsageTemplate())
flags := podStartCommand.Flags() flags := podStartCommand.Flags()
flags.BoolVarP(&podStartCommand.All, "all", "a", false, "Start all pods") flags.BoolVarP(&podStartCommand.All, "all", "a", false, "Start all pods")

View File

@ -22,10 +22,11 @@ import (
var ( var (
podStatsCommand cliconfig.PodStatsValues podStatsCommand cliconfig.PodStatsValues
podStatsDescription = "Display a live stream of resource usage statistics for the containers in or more pods" podStatsDescription = `For each specified pod this command will display percentage of CPU, memory, network I/O, block I/O and PIDs for containers in one the pods.`
_podStatsCommand = &cobra.Command{
_podStatsCommand = &cobra.Command{
Use: "stats [flags] POD [POD...]", Use: "stats [flags] POD [POD...]",
Short: "Display percentage of CPU, memory, network I/O, block I/O and PIDs for containers in one or more pods", Short: "Display a live stream of resource usage statistics for the containers in one or more pods",
Long: podStatsDescription, Long: podStatsDescription,
RunE: func(cmd *cobra.Command, args []string) error { RunE: func(cmd *cobra.Command, args []string) error {
podStatsCommand.InputArgs = args podStatsCommand.InputArgs = args
@ -40,6 +41,7 @@ var (
func init() { func init() {
podStatsCommand.Command = _podStatsCommand podStatsCommand.Command = _podStatsCommand
podStatsCommand.SetHelpTemplate(HelpTemplate())
podStatsCommand.SetUsageTemplate(UsageTemplate()) podStatsCommand.SetUsageTemplate(UsageTemplate())
flags := podStatsCommand.Flags() flags := podStatsCommand.Flags()
flags.BoolVarP(&podStatsCommand.All, "all", "a", false, "Provide stats for all running pods") flags.BoolVarP(&podStatsCommand.All, "all", "a", false, "Provide stats for all running pods")

View File

@ -12,11 +12,9 @@ import (
var ( var (
podStopCommand cliconfig.PodStopValues podStopCommand cliconfig.PodStopValues
podStopDescription = ` podStopDescription = `The pod name or ID can be used.
podman pod stop
Stops one or more running pods. The pod name or ID can be used. This command will stop all running containers in each of the specified pods.`
`
_podStopCommand = &cobra.Command{ _podStopCommand = &cobra.Command{
Use: "stop [flags] POD [POD...]", Use: "stop [flags] POD [POD...]",
@ -38,6 +36,7 @@ var (
func init() { func init() {
podStopCommand.Command = _podStopCommand podStopCommand.Command = _podStopCommand
podStopCommand.SetHelpTemplate(HelpTemplate())
podStopCommand.SetUsageTemplate(UsageTemplate()) podStopCommand.SetUsageTemplate(UsageTemplate())
flags := podStopCommand.Flags() flags := podStopCommand.Flags()
flags.BoolVarP(&podStopCommand.All, "all", "a", false, "Stop all running pods") flags.BoolVarP(&podStopCommand.All, "all", "a", false, "Stop all running pods")

View File

@ -16,12 +16,10 @@ import (
var ( var (
podTopCommand cliconfig.PodTopValues podTopCommand cliconfig.PodTopValues
podTopDescription = fmt.Sprintf(`Display the running processes containers in a pod. Specify format descriptors podTopDescription = fmt.Sprintf(`Specify format descriptors to alter the output.
to alter the output. You may run "podman pod top -l pid pcpu seccomp" to print
the process ID, the CPU percentage and the seccomp mode of each process of You may run "podman pod top -l pid pcpu seccomp" to print the process ID, the CPU percentage and the seccomp mode of each process of the latest pod.
the latest pod. %s`, getDescriptorString())
%s
`, getDescriptorString())
_podTopCommand = &cobra.Command{ _podTopCommand = &cobra.Command{
Use: "top [flags] CONTAINER [FORMAT-DESCRIPTORS]", Use: "top [flags] CONTAINER [FORMAT-DESCRIPTORS]",
@ -40,6 +38,7 @@ the latest pod.
func init() { func init() {
podTopCommand.Command = _podTopCommand podTopCommand.Command = _podTopCommand
podTopCommand.SetHelpTemplate(HelpTemplate())
podTopCommand.SetUsageTemplate(UsageTemplate()) podTopCommand.SetUsageTemplate(UsageTemplate())
flags := podTopCommand.Flags() flags := podTopCommand.Flags()
flags.BoolVarP(&podTopCommand.Latest, "latest,", "l", false, "Act on the latest pod podman is aware of") flags.BoolVarP(&podTopCommand.Latest, "latest,", "l", false, "Act on the latest pod podman is aware of")

View File

@ -12,8 +12,10 @@ import (
var ( var (
podUnpauseCommand cliconfig.PodUnpauseValues podUnpauseCommand cliconfig.PodUnpauseValues
podUnpauseDescription = `Unpauses one or more pods. The pod name or ID can be used.` podUnpauseDescription = `The podman unpause command will unpause all "paused" containers assigned to the pod.
_podUnpauseCommand = &cobra.Command{
The pod name or ID can be used.`
_podUnpauseCommand = &cobra.Command{
Use: "unpause [flags] POD [POD...]", Use: "unpause [flags] POD [POD...]",
Short: "Unpause one or more pods", Short: "Unpause one or more pods",
Long: podUnpauseDescription, Long: podUnpauseDescription,
@ -33,6 +35,7 @@ var (
func init() { func init() {
podUnpauseCommand.Command = _podUnpauseCommand podUnpauseCommand.Command = _podUnpauseCommand
podUnpauseCommand.SetHelpTemplate(HelpTemplate())
podUnpauseCommand.SetUsageTemplate(UsageTemplate()) podUnpauseCommand.SetUsageTemplate(UsageTemplate())
flags := podUnpauseCommand.Flags() flags := podUnpauseCommand.Flags()
flags.BoolVarP(&podUnpauseCommand.All, "all", "a", false, "Unpause all running pods") flags.BoolVarP(&podUnpauseCommand.All, "all", "a", false, "Unpause all running pods")

View File

@ -14,10 +14,7 @@ import (
var ( var (
portCommand cliconfig.PortValues portCommand cliconfig.PortValues
portDescription = ` portDescription = `List port mappings for the CONTAINER, or lookup the public-facing port that is NAT-ed to the PRIVATE_PORT
podman port
List port mappings for the CONTAINER, or lookup the public-facing port that is NAT-ed to the PRIVATE_PORT
` `
_portCommand = &cobra.Command{ _portCommand = &cobra.Command{
Use: "port [flags] CONTAINER", Use: "port [flags] CONTAINER",
@ -39,6 +36,7 @@ var (
func init() { func init() {
portCommand.Command = _portCommand portCommand.Command = _portCommand
portCommand.SetHelpTemplate(HelpTemplate())
portCommand.SetUsageTemplate(UsageTemplate()) portCommand.SetUsageTemplate(UsageTemplate())
flags := portCommand.Flags() flags := portCommand.Flags()

View File

@ -174,6 +174,7 @@ var (
) )
func psInit(command *cliconfig.PsValues) { func psInit(command *cliconfig.PsValues) {
command.SetHelpTemplate(HelpTemplate())
command.SetUsageTemplate(UsageTemplate()) command.SetUsageTemplate(UsageTemplate())
flags := command.Flags() flags := command.Flags()
flags.BoolVarP(&command.All, "all", "a", false, "Show all the containers, default is only running containers") flags.BoolVarP(&command.All, "all", "a", false, "Show all the containers, default is only running containers")

View File

@ -23,11 +23,9 @@ import (
var ( var (
pullCommand cliconfig.PullValues pullCommand cliconfig.PullValues
pullDescription = ` pullDescription = `Pulls an image from a registry and stores it locally.
Pulls an image from a registry and stores it locally.
An image can be pulled using its tag or digest. If a tag is not An image can be pulled using its tag or digest. If a tag is not specified, the image with the 'latest' tag (if it exists) is pulled.`
specified, the image with the 'latest' tag (if it exists) is pulled
`
_pullCommand = &cobra.Command{ _pullCommand = &cobra.Command{
Use: "pull [flags] IMAGE-PATH", Use: "pull [flags] IMAGE-PATH",
Short: "Pull an image from a registry", Short: "Pull an image from a registry",
@ -45,6 +43,7 @@ specified, the image with the 'latest' tag (if it exists) is pulled
func init() { func init() {
pullCommand.Command = _pullCommand pullCommand.Command = _pullCommand
pullCommand.SetHelpTemplate(HelpTemplate())
pullCommand.SetUsageTemplate(UsageTemplate()) pullCommand.SetUsageTemplate(UsageTemplate())
flags := pullCommand.Flags() flags := pullCommand.Flags()
flags.BoolVar(&pullCommand.AllTags, "all-tags", false, "All tagged images inthe repository will be pulled") flags.BoolVar(&pullCommand.AllTags, "all-tags", false, "All tagged images inthe repository will be pulled")

View File

@ -20,10 +20,9 @@ import (
var ( var (
pushCommand cliconfig.PushValues pushCommand cliconfig.PushValues
pushDescription = fmt.Sprintf(` pushDescription = fmt.Sprintf(`Pushes an image to a specified location.
Pushes an image to a specified location.
The Image "DESTINATION" uses a "transport":"details" format. The Image "DESTINATION" uses a "transport":"details" format. See podman-push(1) section "DESTINATION" for the expected format.`)
See podman-push(1) section "DESTINATION" for the expected format`)
_pushCommand = &cobra.Command{ _pushCommand = &cobra.Command{
Use: "push [flags] IMAGE REGISTRY", Use: "push [flags] IMAGE REGISTRY",
@ -42,6 +41,7 @@ var (
func init() { func init() {
pushCommand.Command = _pushCommand pushCommand.Command = _pushCommand
pushCommand.SetHelpTemplate(HelpTemplate())
pushCommand.SetUsageTemplate(UsageTemplate()) pushCommand.SetUsageTemplate(UsageTemplate())
flags := pushCommand.Flags() flags := pushCommand.Flags()
flags.MarkHidden("signature-policy") flags.MarkHidden("signature-policy")

View File

@ -12,8 +12,11 @@ import (
var ( var (
refreshCommand cliconfig.RefreshValues refreshCommand cliconfig.RefreshValues
refreshDescription = "The refresh command resets the state of all containers to handle database changes after a Podman upgrade. All running containers will be restarted." refreshDescription = `Resets the state of all containers to handle database changes after a Podman upgrade.
_refreshCommand = &cobra.Command{
All running containers will be restarted.
`
_refreshCommand = &cobra.Command{
Use: "refresh", Use: "refresh",
Args: noSubArgs, Args: noSubArgs,
Short: "Refresh container state", Short: "Refresh container state",
@ -29,6 +32,7 @@ var (
func init() { func init() {
_refreshCommand.Hidden = true _refreshCommand.Hidden = true
refreshCommand.Command = _refreshCommand refreshCommand.Command = _refreshCommand
refreshCommand.SetHelpTemplate(HelpTemplate())
refreshCommand.SetUsageTemplate(UsageTemplate()) refreshCommand.SetUsageTemplate(UsageTemplate())
} }

View File

@ -16,8 +16,10 @@ import (
var ( var (
restartCommand cliconfig.RestartValues restartCommand cliconfig.RestartValues
restartDescription = `Restarts one or more running containers. The container ID or name can be used. A timeout before forcibly stopping can be set, but defaults to 10 seconds` restartDescription = `Restarts one or more running containers. The container ID or name can be used.
_restartCommand = &cobra.Command{
A timeout before forcibly stopping can be set, but defaults to 10 seconds.`
_restartCommand = &cobra.Command{
Use: "restart [flags] CONTAINER [CONTAINER...]", Use: "restart [flags] CONTAINER [CONTAINER...]",
Short: "Restart one or more containers", Short: "Restart one or more containers",
Long: restartDescription, Long: restartDescription,
@ -37,6 +39,7 @@ var (
func init() { func init() {
restartCommand.Command = _restartCommand restartCommand.Command = _restartCommand
restartCommand.SetHelpTemplate(HelpTemplate())
restartCommand.SetUsageTemplate(UsageTemplate()) restartCommand.SetUsageTemplate(UsageTemplate())
flags := restartCommand.Flags() flags := restartCommand.Flags()
flags.BoolVarP(&restartCommand.All, "all", "a", false, "Restart all non-running containers") flags.BoolVarP(&restartCommand.All, "all", "a", false, "Restart all non-running containers")

View File

@ -40,6 +40,7 @@ var (
func init() { func init() {
restoreCommand.Command = _restoreCommand restoreCommand.Command = _restoreCommand
restoreCommand.SetHelpTemplate(HelpTemplate())
restoreCommand.SetUsageTemplate(UsageTemplate()) restoreCommand.SetUsageTemplate(UsageTemplate())
flags := restoreCommand.Flags() flags := restoreCommand.Flags()
flags.BoolVarP(&restoreCommand.All, "all", "a", false, "Restore all checkpointed containers") flags.BoolVarP(&restoreCommand.All, "all", "a", false, "Restore all checkpointed containers")

View File

@ -15,11 +15,9 @@ import (
var ( var (
rmCommand cliconfig.RmValues rmCommand cliconfig.RmValues
rmDescription = fmt.Sprintf(` rmDescription = fmt.Sprintf(`Removes one or more containers from the host. The container name or ID can be used.
Podman rm will remove one or more containers from the host.
The container name or ID can be used. This does not remove images. Command does not remove images. Running containers will not be removed without the -f option.`)
Running containers will not be removed without the -f option.
`)
_rmCommand = &cobra.Command{ _rmCommand = &cobra.Command{
Use: "rm [flags] CONTAINER [CONTAINER...]", Use: "rm [flags] CONTAINER [CONTAINER...]",
Short: "Remove one or more containers", Short: "Remove one or more containers",
@ -40,6 +38,7 @@ Running containers will not be removed without the -f option.
func init() { func init() {
rmCommand.Command = _rmCommand rmCommand.Command = _rmCommand
rmCommand.SetHelpTemplate(HelpTemplate())
rmCommand.SetUsageTemplate(UsageTemplate()) rmCommand.SetUsageTemplate(UsageTemplate())
flags := rmCommand.Flags() flags := rmCommand.Flags()
flags.BoolVarP(&rmCommand.All, "all", "a", false, "Remove all containers") flags.BoolVarP(&rmCommand.All, "all", "a", false, "Remove all containers")

View File

@ -13,7 +13,7 @@ import (
var ( var (
rmiCommand cliconfig.RmiValues rmiCommand cliconfig.RmiValues
rmiDescription = "Removes one or more locally stored images." rmiDescription = "Removes one or more previously pulled or locally created images."
_rmiCommand = cobra.Command{ _rmiCommand = cobra.Command{
Use: "rmi [flags] IMAGE [IMAGE...]", Use: "rmi [flags] IMAGE [IMAGE...]",
Short: "Removes one or more images from local storage", Short: "Removes one or more images from local storage",
@ -30,6 +30,7 @@ var (
) )
func rmiInit(command *cliconfig.RmiValues) { func rmiInit(command *cliconfig.RmiValues) {
command.SetHelpTemplate(HelpTemplate())
command.SetUsageTemplate(UsageTemplate()) command.SetUsageTemplate(UsageTemplate())
flags := command.Flags() flags := command.Flags()
flags.BoolVarP(&command.All, "all", "a", false, "Remove all images") flags.BoolVarP(&command.All, "all", "a", false, "Remove all images")

View File

@ -39,6 +39,7 @@ var (
func init() { func init() {
runCommand.Command = _runCommand runCommand.Command = _runCommand
runCommand.SetHelpTemplate(HelpTemplate())
runCommand.SetUsageTemplate(UsageTemplate()) runCommand.SetUsageTemplate(UsageTemplate())
flags := runCommand.Flags() flags := runCommand.Flags()
flags.SetInterspersed(false) flags.SetInterspersed(false)

View File

@ -38,6 +38,7 @@ Executes a command as described by a container image label.
func init() { func init() {
runlabelCommand.Command = _runlabelCommand runlabelCommand.Command = _runlabelCommand
runlabelCommand.SetHelpTemplate(HelpTemplate())
runlabelCommand.SetUsageTemplate(UsageTemplate()) runlabelCommand.SetUsageTemplate(UsageTemplate())
flags := runlabelCommand.Flags() flags := runlabelCommand.Flags()
flags.StringVar(&runlabelCommand.Authfile, "authfile", "", "Path of the authentication file. Default is ${XDG_RUNTIME_DIR}/containers/auth.json. Use REGISTRY_AUTH_FILE environment variable to override") flags.StringVar(&runlabelCommand.Authfile, "authfile", "", "Path of the authentication file. Default is ${XDG_RUNTIME_DIR}/containers/auth.json. Use REGISTRY_AUTH_FILE environment variable to override")

View File

@ -23,9 +23,7 @@ var validFormats = []string{ociManifestDir, ociArchive, v2s2ManifestDir, v2s2Arc
var ( var (
saveCommand cliconfig.SaveValues saveCommand cliconfig.SaveValues
saveDescription = ` saveDescription = `Save an image to docker-archive or oci-archive on the local machine. Default is docker-archive.`
Save an image to docker-archive or oci-archive on the local machine.
Default is docker-archive`
_saveCommand = &cobra.Command{ _saveCommand = &cobra.Command{
Use: "save [flags] IMAGE", Use: "save [flags] IMAGE",
@ -54,6 +52,7 @@ var (
func init() { func init() {
saveCommand.Command = _saveCommand saveCommand.Command = _saveCommand
saveCommand.SetHelpTemplate(HelpTemplate())
saveCommand.SetUsageTemplate(UsageTemplate()) saveCommand.SetUsageTemplate(UsageTemplate())
flags := saveCommand.Flags() flags := saveCommand.Flags()
flags.BoolVar(&saveCommand.Compress, "compress", false, "Compress tarball image layers when saving to a directory using the 'dir' transport. (default is same compression type as source)") flags.BoolVar(&saveCommand.Compress, "compress", false, "Compress tarball image layers when saving to a directory using the 'dir' transport. (default is same compression type as source)")

View File

@ -18,9 +18,9 @@ const (
var ( var (
searchCommand cliconfig.SearchValues searchCommand cliconfig.SearchValues
searchDescription = ` searchDescription = `Search registries for a given image. Can search all the default registries or a specific registry.
Search registries for a given image. Can search all the default registries or a specific registry.
Can limit the number of results, and filter the output based on certain conditions.` Users can limit the number of results, and filter the output based on certain conditions.`
_searchCommand = &cobra.Command{ _searchCommand = &cobra.Command{
Use: "search [flags] TERM", Use: "search [flags] TERM",
Short: "Search registry for image", Short: "Search registry for image",
@ -38,6 +38,7 @@ var (
func init() { func init() {
searchCommand.Command = _searchCommand searchCommand.Command = _searchCommand
searchCommand.SetHelpTemplate(HelpTemplate())
searchCommand.SetUsageTemplate(UsageTemplate()) searchCommand.SetUsageTemplate(UsageTemplate())
flags := searchCommand.Flags() flags := searchCommand.Flags()
flags.StringVar(&searchCommand.Authfile, "authfile", "", "Path of the authentication file. Default is ${XDG_RUNTIME_DIR}/containers/auth.json. Use REGISTRY_AUTH_FILE environment variable to override") flags.StringVar(&searchCommand.Authfile, "authfile", "", "Path of the authentication file. Default is ${XDG_RUNTIME_DIR}/containers/auth.json. Use REGISTRY_AUTH_FILE environment variable to override")

View File

@ -22,7 +22,7 @@ import (
var ( var (
signCommand cliconfig.SignValues signCommand cliconfig.SignValues
signDescription = "Create a signature file that can be used later to verify the image" signDescription = "Create a signature file that can be used later to verify the image."
_signCommand = &cobra.Command{ _signCommand = &cobra.Command{
Use: "sign [flags] IMAGE [IMAGE...]", Use: "sign [flags] IMAGE [IMAGE...]",
Short: "Sign an image", Short: "Sign an image",
@ -39,6 +39,7 @@ var (
func init() { func init() {
signCommand.Command = _signCommand signCommand.Command = _signCommand
signCommand.SetHelpTemplate(HelpTemplate())
signCommand.SetUsageTemplate(UsageTemplate()) signCommand.SetUsageTemplate(UsageTemplate())
flags := signCommand.Flags() flags := signCommand.Flags()
flags.StringVarP(&signCommand.Directory, "directory", "d", "", "Define an alternate directory to store signatures") flags.StringVarP(&signCommand.Directory, "directory", "d", "", "Define an alternate directory to store signatures")

View File

@ -15,11 +15,8 @@ import (
var ( var (
startCommand cliconfig.StartValues startCommand cliconfig.StartValues
startDescription = ` startDescription = `Starts one or more containers. The container name or ID can be used.`
podman start
Starts one or more containers. The container name or ID can be used.
`
_startCommand = &cobra.Command{ _startCommand = &cobra.Command{
Use: "start [flags] CONTAINER [CONTAINER...]", Use: "start [flags] CONTAINER [CONTAINER...]",
Short: "Start one or more containers", Short: "Start one or more containers",
@ -37,6 +34,7 @@ var (
func init() { func init() {
startCommand.Command = _startCommand startCommand.Command = _startCommand
startCommand.SetHelpTemplate(HelpTemplate())
startCommand.SetUsageTemplate(UsageTemplate()) startCommand.SetUsageTemplate(UsageTemplate())
flags := startCommand.Flags() flags := startCommand.Flags()
flags.BoolVarP(&startCommand.Attach, "attach", "a", false, "Attach container's STDOUT and STDERR") flags.BoolVarP(&startCommand.Attach, "attach", "a", false, "Attach container's STDOUT and STDERR")

View File

@ -31,10 +31,10 @@ type statsOutputParams struct {
var ( var (
statsCommand cliconfig.StatsValues statsCommand cliconfig.StatsValues
statsDescription = "display a live stream of one or more containers' resource usage statistics" statsDescription = "Display percentage of CPU, memory, network I/O, block I/O and PIDs for one or more containers."
_statsCommand = &cobra.Command{ _statsCommand = &cobra.Command{
Use: "stats [flags] CONTAINER [CONTAINER...]", Use: "stats [flags] CONTAINER [CONTAINER...]",
Short: "Display percentage of CPU, memory, network I/O, block I/O and PIDs for one or more containers", Short: "Display a live stream of container resource usage statistics",
Long: statsDescription, Long: statsDescription,
RunE: func(cmd *cobra.Command, args []string) error { RunE: func(cmd *cobra.Command, args []string) error {
statsCommand.InputArgs = args statsCommand.InputArgs = args
@ -52,6 +52,7 @@ var (
func init() { func init() {
statsCommand.Command = _statsCommand statsCommand.Command = _statsCommand
statsCommand.SetHelpTemplate(HelpTemplate())
statsCommand.SetUsageTemplate(UsageTemplate()) statsCommand.SetUsageTemplate(UsageTemplate())
flags := statsCommand.Flags() flags := statsCommand.Flags()
flags.BoolVarP(&statsCommand.All, "all", "a", false, "Show all containers. Only running containers are shown by default. The default is false") flags.BoolVarP(&statsCommand.All, "all", "a", false, "Show all containers. Only running containers are shown by default. The default is false")

View File

@ -15,13 +15,9 @@ import (
var ( var (
stopCommand cliconfig.StopValues stopCommand cliconfig.StopValues
stopDescription = ` stopDescription = `Stops one or more running containers. The container name or ID can be used.
podman stop
Stops one or more running containers. The container name or ID can be used. A timeout to forcibly stop the container can also be set but defaults to 10 seconds otherwise.`
A timeout to forcibly stop the container can also be set but defaults to 10
seconds otherwise.
`
_stopCommand = &cobra.Command{ _stopCommand = &cobra.Command{
Use: "stop [flags] CONTAINER [CONTAINER...]", Use: "stop [flags] CONTAINER [CONTAINER...]",
Short: "Stop one or more containers", Short: "Stop one or more containers",
@ -42,6 +38,7 @@ var (
func init() { func init() {
stopCommand.Command = _stopCommand stopCommand.Command = _stopCommand
stopCommand.SetHelpTemplate(HelpTemplate())
stopCommand.SetUsageTemplate(UsageTemplate()) stopCommand.SetUsageTemplate(UsageTemplate())
flags := stopCommand.Flags() flags := stopCommand.Flags()
flags.BoolVarP(&stopCommand.All, "all", "a", false, "Stop all running containers") flags.BoolVarP(&stopCommand.All, "all", "a", false, "Stop all running containers")

View File

@ -36,6 +36,7 @@ var (
func init() { func init() {
pruneSystemCommand.Command = _pruneSystemCommand pruneSystemCommand.Command = _pruneSystemCommand
pruneSystemCommand.SetHelpTemplate(HelpTemplate())
pruneSystemCommand.SetUsageTemplate(UsageTemplate()) pruneSystemCommand.SetUsageTemplate(UsageTemplate())
flags := pruneSystemCommand.Flags() flags := pruneSystemCommand.Flags()
flags.BoolVarP(&pruneSystemCommand.All, "all", "a", false, "Remove all unused data") flags.BoolVarP(&pruneSystemCommand.All, "all", "a", false, "Remove all unused data")

View File

@ -31,6 +31,7 @@ var (
func init() { func init() {
renumberCommand.Command = _renumberCommand renumberCommand.Command = _renumberCommand
renumberCommand.SetHelpTemplate(HelpTemplate())
renumberCommand.SetUsageTemplate(UsageTemplate()) renumberCommand.SetUsageTemplate(UsageTemplate())
} }

View File

@ -10,7 +10,7 @@ import (
var ( var (
tagCommand cliconfig.TagValues tagCommand cliconfig.TagValues
tagDescription = "Adds one or more additional names to locally-stored image" tagDescription = "Adds one or more additional names to locally-stored image."
_tagCommand = &cobra.Command{ _tagCommand = &cobra.Command{
Use: "tag [flags] IMAGE TAG [TAG...]", Use: "tag [flags] IMAGE TAG [TAG...]",
Short: "Add an additional name to a local image", Short: "Add an additional name to a local image",
@ -28,6 +28,7 @@ var (
func init() { func init() {
tagCommand.Command = _tagCommand tagCommand.Command = _tagCommand
tagCommand.SetHelpTemplate(HelpTemplate())
tagCommand.SetUsageTemplate(UsageTemplate()) tagCommand.SetUsageTemplate(UsageTemplate())
} }

View File

@ -18,20 +18,20 @@ func getDescriptorString() string {
descriptors, err := libpod.GetContainerPidInformationDescriptors() descriptors, err := libpod.GetContainerPidInformationDescriptors()
if err == nil { if err == nil {
return fmt.Sprintf(` return fmt.Sprintf(`
Format Descriptors: Format Descriptors:
%s`, strings.Join(descriptors, ",")) %s`, strings.Join(descriptors, ","))
} }
return "" return ""
} }
var ( var (
topCommand cliconfig.TopValues topCommand cliconfig.TopValues
topDescription = fmt.Sprintf(`Display the running processes of the container. Specify format descriptors topDescription = fmt.Sprintf(`Similar to system "top" command.
to alter the output. You may run "podman top -l pid pcpu seccomp" to print
the process ID, the CPU percentage and the seccomp mode of each process of Specify format descriptors to alter the output.
the latest container.
%s Running "podman top -l pid pcpu seccomp" will print the process ID, the CPU percentage and the seccomp mode of each process of the latest container.
`, getDescriptorString()) %s`, getDescriptorString())
_topCommand = &cobra.Command{ _topCommand = &cobra.Command{
Use: "top [flags] CONTAINER [FORMAT-DESCRIPTIOS]", Use: "top [flags] CONTAINER [FORMAT-DESCRIPTIOS]",
@ -50,6 +50,7 @@ the latest container.
func init() { func init() {
topCommand.Command = _topCommand topCommand.Command = _topCommand
topCommand.SetHelpTemplate(HelpTemplate())
topCommand.SetUsageTemplate(UsageTemplate()) topCommand.SetUsageTemplate(UsageTemplate())
flags := topCommand.Flags() flags := topCommand.Flags()
flags.BoolVar(&topCommand.ListDescriptors, "list-descriptors", false, "") flags.BoolVar(&topCommand.ListDescriptors, "list-descriptors", false, "")

View File

@ -6,16 +6,20 @@ import (
) )
var ( var (
trustDescription = `Manages which registries you trust as a source of container images based on its location.
The location is determined by the transport and the registry host of the image. Using this container image docker://docker.io/library/busybox as an example, docker is the transport and docker.io is the registry host.`
trustCommand = cliconfig.PodmanCommand{ trustCommand = cliconfig.PodmanCommand{
Command: &cobra.Command{ Command: &cobra.Command{
Use: "trust", Use: "trust",
Short: "Manage container image trust policy", Short: "Manage container image trust policy",
Long: "podman image trust command", Long: trustDescription,
}, },
} }
) )
func init() { func init() {
trustCommand.SetHelpTemplate(HelpTemplate())
trustCommand.SetUsageTemplate(UsageTemplate()) trustCommand.SetUsageTemplate(UsageTemplate())
trustCommand.AddCommand(getTrustSubCommands()...) trustCommand.AddCommand(getTrustSubCommands()...)
imageCommand.AddCommand(trustCommand.Command) imageCommand.AddCommand(trustCommand.Command)

View File

@ -50,8 +50,10 @@ var (
func init() { func init() {
setTrustCommand.Command = _setTrustCommand setTrustCommand.Command = _setTrustCommand
setTrustCommand.SetHelpTemplate(HelpTemplate())
setTrustCommand.SetUsageTemplate(UsageTemplate()) setTrustCommand.SetUsageTemplate(UsageTemplate())
showTrustCommand.Command = _showTrustCommand showTrustCommand.Command = _showTrustCommand
showTrustCommand.SetHelpTemplate(HelpTemplate())
showTrustCommand.SetUsageTemplate(UsageTemplate()) showTrustCommand.SetUsageTemplate(UsageTemplate())
setFlags := setTrustCommand.Flags() setFlags := setTrustCommand.Flags()
setFlags.StringVar(&setTrustCommand.PolicyPath, "policypath", "", "") setFlags.StringVar(&setTrustCommand.PolicyPath, "policypath", "", "")

View File

@ -14,12 +14,11 @@ import (
var ( var (
umountCommand cliconfig.UmountValues umountCommand cliconfig.UmountValues
description = ` description = `Container storage increments a mount counter each time a container is mounted.
Container storage increments a mount counter each time a container is mounted.
When a container is unmounted, the mount counter is decremented and the When a container is unmounted, the mount counter is decremented. The container's root filesystem is physically unmounted only when the mount counter reaches zero indicating no other processes are using the mount.
container's root filesystem is physically unmounted only when the mount
counter reaches zero indicating no other processes are using the mount. An unmount can be forced with the --force flag.
An unmount can be forced with the --force flag.
` `
_umountCommand = &cobra.Command{ _umountCommand = &cobra.Command{
Use: "umount [flags] CONTAINER [CONTAINER...]", Use: "umount [flags] CONTAINER [CONTAINER...]",
@ -42,6 +41,7 @@ An unmount can be forced with the --force flag.
func init() { func init() {
umountCommand.Command = _umountCommand umountCommand.Command = _umountCommand
umountCommand.SetHelpTemplate(HelpTemplate())
umountCommand.SetUsageTemplate(UsageTemplate()) umountCommand.SetUsageTemplate(UsageTemplate())
flags := umountCommand.Flags() flags := umountCommand.Flags()
flags.BoolVarP(&umountCommand.All, "all", "a", false, "Umount all of the currently mounted containers") flags.BoolVarP(&umountCommand.All, "all", "a", false, "Umount all of the currently mounted containers")

View File

@ -15,12 +15,8 @@ import (
var ( var (
unpauseCommand cliconfig.UnpauseValues unpauseCommand cliconfig.UnpauseValues
unpauseDescription = ` unpauseDescription = `Unpauses one or more previously paused containers. The container name or ID can be used.`
podman unpause _unpauseCommand = &cobra.Command{
Unpauses one or more running containers. The container name or ID can be used.
`
_unpauseCommand = &cobra.Command{
Use: "unpause [flags] CONTAINER [CONTAINER...]", Use: "unpause [flags] CONTAINER [CONTAINER...]",
Short: "Unpause the processes in one or more containers", Short: "Unpause the processes in one or more containers",
Long: unpauseDescription, Long: unpauseDescription,
@ -36,6 +32,7 @@ var (
func init() { func init() {
unpauseCommand.Command = _unpauseCommand unpauseCommand.Command = _unpauseCommand
unpauseCommand.SetHelpTemplate(HelpTemplate())
unpauseCommand.SetUsageTemplate(UsageTemplate()) unpauseCommand.SetUsageTemplate(UsageTemplate())
flags := unpauseCommand.Flags() flags := unpauseCommand.Flags()
flags.BoolVarP(&unpauseCommand.All, "all", "a", false, "Unpause all paused containers") flags.BoolVarP(&unpauseCommand.All, "all", "a", false, "Unpause all paused containers")

View File

@ -18,10 +18,9 @@ import (
var ( var (
varlinkCommand cliconfig.VarlinkValues varlinkCommand cliconfig.VarlinkValues
varlinkDescription = ` varlinkDescription = `Run varlink interface. Podman varlink listens on the specified unix domain socket for incoming connects.
podman varlink
run varlink interface Tools speaking varlink protocol can remotely manage pods, containers and images.
` `
_varlinkCommand = &cobra.Command{ _varlinkCommand = &cobra.Command{
Use: "varlink [flags] URI", Use: "varlink [flags] URI",
@ -39,6 +38,7 @@ var (
func init() { func init() {
varlinkCommand.Command = _varlinkCommand varlinkCommand.Command = _varlinkCommand
varlinkCommand.SetHelpTemplate(HelpTemplate())
varlinkCommand.SetUsageTemplate(UsageTemplate()) varlinkCommand.SetUsageTemplate(UsageTemplate())
flags := varlinkCommand.Flags() flags := varlinkCommand.Flags()
flags.Int64VarP(&varlinkCommand.Timeout, "timeout", "t", 1000, "Time until the varlink session expires in milliseconds. Use 0 to disable the timeout") flags.Int64VarP(&varlinkCommand.Timeout, "timeout", "t", 1000, "Time until the varlink session expires in milliseconds. Use 0 to disable the timeout")

View File

@ -5,9 +5,7 @@ import (
"github.com/spf13/cobra" "github.com/spf13/cobra"
) )
var volumeDescription = `Manage volumes. var volumeDescription = `Volumes are created in and can be shared between containers.`
Volumes are created in and can be shared between containers.`
var volumeCommand = cliconfig.PodmanCommand{ var volumeCommand = cliconfig.PodmanCommand{
Command: &cobra.Command{ Command: &cobra.Command{

View File

@ -11,11 +11,7 @@ import (
var ( var (
volumeCreateCommand cliconfig.VolumeCreateValues volumeCreateCommand cliconfig.VolumeCreateValues
volumeCreateDescription = ` volumeCreateDescription = `If using the default driver, "local", the volume will be created on the host in the volumes directory under container storage.`
podman volume create
Creates a new volume. If using the default driver, "local", the volume will
be created at.`
_volumeCreateCommand = &cobra.Command{ _volumeCreateCommand = &cobra.Command{
Use: "create [flags] [NAME]", Use: "create [flags] [NAME]",
@ -34,6 +30,7 @@ be created at.`
func init() { func init() {
volumeCreateCommand.Command = _volumeCreateCommand volumeCreateCommand.Command = _volumeCreateCommand
volumeCommand.SetHelpTemplate(HelpTemplate())
volumeCreateCommand.SetUsageTemplate(UsageTemplate()) volumeCreateCommand.SetUsageTemplate(UsageTemplate())
flags := volumeCreateCommand.Flags() flags := volumeCreateCommand.Flags()
flags.StringVar(&volumeCreateCommand.Driver, "driver", "", "Specify volume driver name (default local)") flags.StringVar(&volumeCreateCommand.Driver, "driver", "", "Specify volume driver name (default local)")

View File

@ -9,12 +9,9 @@ import (
var ( var (
volumeInspectCommand cliconfig.VolumeInspectValues volumeInspectCommand cliconfig.VolumeInspectValues
volumeInspectDescription = ` volumeInspectDescription = `Display detailed information on one or more volumes.
podman volume inspect
Display detailed information on one or more volumes. Can change the format Use a Go template to change the format from JSON.`
from JSON to a Go template.
`
_volumeInspectCommand = &cobra.Command{ _volumeInspectCommand = &cobra.Command{
Use: "inspect [flags] VOLUME [VOLUME...]", Use: "inspect [flags] VOLUME [VOLUME...]",
Short: "Display detailed information on one or more volumes", Short: "Display detailed information on one or more volumes",
@ -32,6 +29,7 @@ from JSON to a Go template.
func init() { func init() {
volumeInspectCommand.Command = _volumeInspectCommand volumeInspectCommand.Command = _volumeInspectCommand
volumeInspectCommand.SetHelpTemplate(HelpTemplate())
volumeInspectCommand.SetUsageTemplate(UsageTemplate()) volumeInspectCommand.SetUsageTemplate(UsageTemplate())
flags := volumeInspectCommand.Flags() flags := volumeInspectCommand.Flags()
flags.BoolVarP(&volumeInspectCommand.All, "all", "a", false, "Inspect all volumes") flags.BoolVarP(&volumeInspectCommand.All, "all", "a", false, "Inspect all volumes")

View File

@ -44,8 +44,7 @@ var (
podman volume ls podman volume ls
List all available volumes. The output of the volumes can be filtered List all available volumes. The output of the volumes can be filtered
and the output format can be changed to JSON or a user specified Go template. and the output format can be changed to JSON or a user specified Go template.`
`
_volumeLsCommand = &cobra.Command{ _volumeLsCommand = &cobra.Command{
Use: "ls", Use: "ls",
Aliases: []string{"list"}, Aliases: []string{"list"},
@ -62,6 +61,7 @@ and the output format can be changed to JSON or a user specified Go template.
func init() { func init() {
volumeLsCommand.Command = _volumeLsCommand volumeLsCommand.Command = _volumeLsCommand
volumeLsCommand.SetHelpTemplate(HelpTemplate())
volumeLsCommand.SetUsageTemplate(UsageTemplate()) volumeLsCommand.SetUsageTemplate(UsageTemplate())
flags := volumeLsCommand.Flags() flags := volumeLsCommand.Flags()

View File

@ -16,12 +16,10 @@ import (
var ( var (
volumePruneCommand cliconfig.VolumePruneValues volumePruneCommand cliconfig.VolumePruneValues
volumePruneDescription = ` volumePruneDescription = `Volumes that are not currently owned by a container will be removed.
podman volume prune
Remove all unused volumes. Will prompt for confirmation if not The command prompts for confirmation which can be overridden with the --force flag.
using force. Note all data will be destroyed.`
`
_volumePruneCommand = &cobra.Command{ _volumePruneCommand = &cobra.Command{
Use: "prune", Use: "prune",
Args: noSubArgs, Args: noSubArgs,
@ -37,6 +35,7 @@ using force.
func init() { func init() {
volumePruneCommand.Command = _volumePruneCommand volumePruneCommand.Command = _volumePruneCommand
volumePruneCommand.SetHelpTemplate(HelpTemplate())
volumePruneCommand.SetUsageTemplate(UsageTemplate()) volumePruneCommand.SetUsageTemplate(UsageTemplate())
flags := volumePruneCommand.Flags() flags := volumePruneCommand.Flags()

View File

@ -11,13 +11,9 @@ import (
var ( var (
volumeRmCommand cliconfig.VolumeRmValues volumeRmCommand cliconfig.VolumeRmValues
volumeRmDescription = ` volumeRmDescription = `Remove one or more existing volumes.
podman volume rm
Remove one or more existing volumes. Will only remove volumes that are By default only volumes that are not being used by any containers will be removed. To remove the volumes anyways, use the --force flag.`
not being used by any containers. To remove the volumes anyways, use the
--force flag.
`
_volumeRmCommand = &cobra.Command{ _volumeRmCommand = &cobra.Command{
Use: "rm [flags] VOLUME [VOLUME...]", Use: "rm [flags] VOLUME [VOLUME...]",
Aliases: []string{"remove"}, Aliases: []string{"remove"},
@ -36,6 +32,7 @@ not being used by any containers. To remove the volumes anyways, use the
func init() { func init() {
volumeRmCommand.Command = _volumeRmCommand volumeRmCommand.Command = _volumeRmCommand
volumeRmCommand.SetHelpTemplate(HelpTemplate())
volumeRmCommand.SetUsageTemplate(UsageTemplate()) volumeRmCommand.SetUsageTemplate(UsageTemplate())
flags := volumeRmCommand.Flags() flags := volumeRmCommand.Flags()
flags.BoolVarP(&volumeRmCommand.All, "all", "a", false, "Remove all volumes") flags.BoolVarP(&volumeRmCommand.All, "all", "a", false, "Remove all volumes")

View File

@ -14,10 +14,7 @@ import (
var ( var (
waitCommand cliconfig.WaitValues waitCommand cliconfig.WaitValues
waitDescription = ` waitDescription = `Block until one or more containers stop and then print their exit codes.
podman wait
Block until one or more containers stop and then print their exit codes
` `
_waitCommand = &cobra.Command{ _waitCommand = &cobra.Command{
Use: "wait [flags] CONTAINER [CONTAINER...]", Use: "wait [flags] CONTAINER [CONTAINER...]",
@ -36,6 +33,7 @@ var (
func init() { func init() {
waitCommand.Command = _waitCommand waitCommand.Command = _waitCommand
waitCommand.SetHelpTemplate(HelpTemplate())
waitCommand.SetUsageTemplate(UsageTemplate()) waitCommand.SetUsageTemplate(UsageTemplate())
flags := waitCommand.Flags() flags := waitCommand.Flags()
flags.UintVarP(&waitCommand.Interval, "interval", "i", 250, "Milliseconds to wait before polling for completion") flags.UintVarP(&waitCommand.Interval, "interval", "i", 250, "Milliseconds to wait before polling for completion")