mirror of
https://github.com/containers/podman.git
synced 2025-05-21 00:56:36 +08:00
Switch use of Flags to Options
Want to have man pages match commands, since we have lots of printed man pages with using Options, we will change the command line to use Options in --help. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
This commit is contained in:
@ -20,7 +20,7 @@ var (
|
|||||||
or similar units that create new containers in order to run the updated images.
|
or similar units that create new containers in order to run the updated images.
|
||||||
Note that this command is experimental. Please refer to the podman-auto-update(1) man page for details.`
|
Note that this command is experimental. Please refer to the podman-auto-update(1) man page for details.`
|
||||||
autoUpdateCommand = &cobra.Command{
|
autoUpdateCommand = &cobra.Command{
|
||||||
Use: "auto-update [flags]",
|
Use: "auto-update [options]",
|
||||||
Short: "Auto update containers according to their auto-update policy",
|
Short: "Auto update containers according to their auto-update policy",
|
||||||
Long: autoUpdateDescription,
|
Long: autoUpdateDescription,
|
||||||
RunE: autoUpdate,
|
RunE: autoUpdate,
|
||||||
|
@ -14,7 +14,7 @@ import (
|
|||||||
var (
|
var (
|
||||||
attachDescription = "The podman attach command allows you to attach to a running container using the container's ID or name, either to view its ongoing output or to control it interactively."
|
attachDescription = "The podman attach command allows you to attach to a running container using the container's ID or name, either to view its ongoing output or to control it interactively."
|
||||||
attachCommand = &cobra.Command{
|
attachCommand = &cobra.Command{
|
||||||
Use: "attach [flags] CONTAINER",
|
Use: "attach [options] CONTAINER",
|
||||||
Short: "Attach to a running container",
|
Short: "Attach to a running container",
|
||||||
Long: attachDescription,
|
Long: attachDescription,
|
||||||
RunE: attach,
|
RunE: attach,
|
||||||
|
@ -20,7 +20,7 @@ var (
|
|||||||
Checkpoints one or more running containers. The container name or ID can be used.
|
Checkpoints one or more running containers. The container name or ID can be used.
|
||||||
`
|
`
|
||||||
checkpointCommand = &cobra.Command{
|
checkpointCommand = &cobra.Command{
|
||||||
Use: "checkpoint [flags] CONTAINER [CONTAINER...]",
|
Use: "checkpoint [options] CONTAINER [CONTAINER...]",
|
||||||
Short: "Checkpoints one or more containers",
|
Short: "Checkpoints one or more containers",
|
||||||
Long: checkpointDescription,
|
Long: checkpointDescription,
|
||||||
RunE: checkpoint,
|
RunE: checkpoint,
|
||||||
|
@ -19,7 +19,7 @@ var (
|
|||||||
Cleans up mount points and network stacks on one or more containers from the host. The container name or ID can be used. This command is used internally when running containers, but can also be used if container cleanup has failed when a container exits.
|
Cleans up mount points and network stacks on one or more containers from the host. The container name or ID can be used. This command is used internally when running containers, but can also be used if container cleanup has failed when a container exits.
|
||||||
`
|
`
|
||||||
cleanupCommand = &cobra.Command{
|
cleanupCommand = &cobra.Command{
|
||||||
Use: "cleanup [flags] CONTAINER [CONTAINER...]",
|
Use: "cleanup [options] CONTAINER [CONTAINER...]",
|
||||||
Short: "Cleanup network and mountpoints of one or more containers",
|
Short: "Cleanup network and mountpoints of one or more containers",
|
||||||
Long: cleanupDescription,
|
Long: cleanupDescription,
|
||||||
RunE: cleanup,
|
RunE: cleanup,
|
||||||
|
@ -18,7 +18,7 @@ var (
|
|||||||
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.`
|
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.`
|
||||||
|
|
||||||
commitCommand = &cobra.Command{
|
commitCommand = &cobra.Command{
|
||||||
Use: "commit [flags] CONTAINER [IMAGE]",
|
Use: "commit [options] CONTAINER [IMAGE]",
|
||||||
Short: "Create new image based on the changed container",
|
Short: "Create new image based on the changed container",
|
||||||
Long: commitDescription,
|
Long: commitDescription,
|
||||||
RunE: commit,
|
RunE: commit,
|
||||||
|
@ -16,7 +16,7 @@ var (
|
|||||||
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.
|
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{
|
cpCommand = &cobra.Command{
|
||||||
Use: "cp [flags] SRC_PATH DEST_PATH",
|
Use: "cp [options] 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,
|
||||||
Args: cobra.ExactArgs(2),
|
Args: cobra.ExactArgs(2),
|
||||||
|
@ -29,7 +29,7 @@ var (
|
|||||||
|
|
||||||
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'.`
|
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'.`
|
||||||
createCommand = &cobra.Command{
|
createCommand = &cobra.Command{
|
||||||
Use: "create [flags] IMAGE [COMMAND [ARG...]]",
|
Use: "create [options] IMAGE [COMMAND [ARG...]]",
|
||||||
Short: "Create but do not start a container",
|
Short: "Create but do not start a container",
|
||||||
Long: createDescription,
|
Long: createDescription,
|
||||||
RunE: create,
|
RunE: create,
|
||||||
|
@ -13,7 +13,7 @@ import (
|
|||||||
var (
|
var (
|
||||||
// podman container _diff_
|
// podman container _diff_
|
||||||
diffCmd = &cobra.Command{
|
diffCmd = &cobra.Command{
|
||||||
Use: "diff [flags] CONTAINER",
|
Use: "diff [options] CONTAINER",
|
||||||
Args: validate.IDOrLatestArgs,
|
Args: validate.IDOrLatestArgs,
|
||||||
Short: "Inspect changes to the container's file systems",
|
Short: "Inspect changes to the container's file systems",
|
||||||
Long: `Displays changes to the container filesystem's'. The container will be compared to its parent layer.`,
|
Long: `Displays changes to the container filesystem's'. The container will be compared to its parent layer.`,
|
||||||
|
@ -20,7 +20,7 @@ var (
|
|||||||
execDescription = `Execute the specified command inside a running container.
|
execDescription = `Execute the specified command inside a running container.
|
||||||
`
|
`
|
||||||
execCommand = &cobra.Command{
|
execCommand = &cobra.Command{
|
||||||
Use: "exec [flags] CONTAINER [COMMAND [ARG...]]",
|
Use: "exec [options] CONTAINER [COMMAND [ARG...]]",
|
||||||
Short: "Run a process in a running container",
|
Short: "Run a process in a running container",
|
||||||
Long: execDescription,
|
Long: execDescription,
|
||||||
RunE: exec,
|
RunE: exec,
|
||||||
|
@ -12,7 +12,7 @@ var (
|
|||||||
containerExistsDescription = `If the named container exists in local storage, podman container exists exits with 0, otherwise the exit code will be 1.`
|
containerExistsDescription = `If the named container exists in local storage, podman container exists exits with 0, otherwise the exit code will be 1.`
|
||||||
|
|
||||||
existsCommand = &cobra.Command{
|
existsCommand = &cobra.Command{
|
||||||
Use: "exists [flags] CONTAINER",
|
Use: "exists [options] CONTAINER",
|
||||||
Short: "Check if a container exists in local storage",
|
Short: "Check if a container exists in local storage",
|
||||||
Long: containerExistsDescription,
|
Long: containerExistsDescription,
|
||||||
Example: `podman container exists --external containerID
|
Example: `podman container exists --external containerID
|
||||||
|
@ -18,7 +18,7 @@ var (
|
|||||||
" and saves it on the local machine."
|
" and saves it on the local machine."
|
||||||
|
|
||||||
exportCommand = &cobra.Command{
|
exportCommand = &cobra.Command{
|
||||||
Use: "export [flags] CONTAINER",
|
Use: "export [options] CONTAINER",
|
||||||
Short: "Export container's filesystem contents as a tar archive",
|
Short: "Export container's filesystem contents as a tar archive",
|
||||||
Long: exportDescription,
|
Long: exportDescription,
|
||||||
RunE: export,
|
RunE: export,
|
||||||
|
@ -15,7 +15,7 @@ var (
|
|||||||
initDescription = `Initialize one or more containers, creating the OCI spec and mounts for inspection. Container names or IDs can be used.`
|
initDescription = `Initialize one or more containers, creating the OCI spec and mounts for inspection. Container names or IDs can be used.`
|
||||||
|
|
||||||
initCommand = &cobra.Command{
|
initCommand = &cobra.Command{
|
||||||
Use: "init [flags] CONTAINER [CONTAINER...]",
|
Use: "init [options] CONTAINER [CONTAINER...]",
|
||||||
Short: "Initialize one or more containers",
|
Short: "Initialize one or more containers",
|
||||||
Long: initDescription,
|
Long: initDescription,
|
||||||
RunE: initContainer,
|
RunE: initContainer,
|
||||||
|
@ -11,7 +11,7 @@ import (
|
|||||||
var (
|
var (
|
||||||
// podman container _inspect_
|
// podman container _inspect_
|
||||||
inspectCmd = &cobra.Command{
|
inspectCmd = &cobra.Command{
|
||||||
Use: "inspect [flags] CONTAINER [CONTAINER...]",
|
Use: "inspect [options] CONTAINER [CONTAINER...]",
|
||||||
Short: "Display the configuration of a container",
|
Short: "Display the configuration of a container",
|
||||||
Long: `Displays the low-level information on a container identified by name or ID.`,
|
Long: `Displays the low-level information on a container identified by name or ID.`,
|
||||||
RunE: inspectExec,
|
RunE: inspectExec,
|
||||||
|
@ -17,7 +17,7 @@ import (
|
|||||||
var (
|
var (
|
||||||
killDescription = "The main process inside each container specified will be sent SIGKILL, or any signal specified with option --signal."
|
killDescription = "The main process inside each container specified will be sent SIGKILL, or any signal specified with option --signal."
|
||||||
killCommand = &cobra.Command{
|
killCommand = &cobra.Command{
|
||||||
Use: "kill [flags] CONTAINER [CONTAINER...]",
|
Use: "kill [options] CONTAINER [CONTAINER...]",
|
||||||
Short: "Kill one or more running containers with a specific signal",
|
Short: "Kill one or more running containers with a specific signal",
|
||||||
Long: killDescription,
|
Long: killDescription,
|
||||||
RunE: kill,
|
RunE: kill,
|
||||||
|
@ -10,7 +10,7 @@ import (
|
|||||||
var (
|
var (
|
||||||
// podman container _list_
|
// podman container _list_
|
||||||
listCmd = &cobra.Command{
|
listCmd = &cobra.Command{
|
||||||
Use: "list",
|
Use: "list [options]",
|
||||||
Aliases: []string{"ls"},
|
Aliases: []string{"ls"},
|
||||||
Args: validate.NoArgs,
|
Args: validate.NoArgs,
|
||||||
Short: "List containers",
|
Short: "List containers",
|
||||||
|
@ -27,7 +27,7 @@ var (
|
|||||||
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).
|
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 [CONTAINER...]",
|
Use: "logs [options] CONTAINER [CONTAINER...]",
|
||||||
Short: "Fetch the logs of one or more containers",
|
Short: "Fetch the logs of one or more containers",
|
||||||
Long: logsDescription,
|
Long: logsDescription,
|
||||||
Args: func(cmd *cobra.Command, args []string) error {
|
Args: func(cmd *cobra.Command, args []string) error {
|
||||||
|
@ -25,7 +25,7 @@ var (
|
|||||||
`
|
`
|
||||||
|
|
||||||
mountCommand = &cobra.Command{
|
mountCommand = &cobra.Command{
|
||||||
Use: "mount [flags] [CONTAINER...]",
|
Use: "mount [options] [CONTAINER...]",
|
||||||
Short: "Mount a working container's root filesystem",
|
Short: "Mount a working container's root filesystem",
|
||||||
Long: mountDescription,
|
Long: mountDescription,
|
||||||
RunE: mount,
|
RunE: mount,
|
||||||
|
@ -17,7 +17,7 @@ import (
|
|||||||
var (
|
var (
|
||||||
pauseDescription = `Pauses one or more running containers. The container name or ID can be used.`
|
pauseDescription = `Pauses one or more running containers. The container name or ID can be used.`
|
||||||
pauseCommand = &cobra.Command{
|
pauseCommand = &cobra.Command{
|
||||||
Use: "pause [flags] CONTAINER [CONTAINER...]",
|
Use: "pause [options] 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,
|
||||||
RunE: pause,
|
RunE: pause,
|
||||||
|
@ -18,7 +18,7 @@ var (
|
|||||||
portDescription = `List port mappings for the CONTAINER, or lookup the public-facing port that is NAT-ed to the PRIVATE_PORT
|
portDescription = `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 [PORT]",
|
Use: "port [options] CONTAINER [PORT]",
|
||||||
Short: "List port mappings or a specific mapping for the container",
|
Short: "List port mappings or a specific mapping for the container",
|
||||||
Long: portDescription,
|
Long: portDescription,
|
||||||
RunE: port,
|
RunE: port,
|
||||||
@ -31,7 +31,7 @@ var (
|
|||||||
}
|
}
|
||||||
|
|
||||||
containerPortCommand = &cobra.Command{
|
containerPortCommand = &cobra.Command{
|
||||||
Use: "port [flags] CONTAINER [PORT]",
|
Use: "port [options] CONTAINER [PORT]",
|
||||||
Short: portCommand.Short,
|
Short: portCommand.Short,
|
||||||
Long: portDescription,
|
Long: portDescription,
|
||||||
RunE: portCommand.RunE,
|
RunE: portCommand.RunE,
|
||||||
|
@ -21,7 +21,7 @@ var (
|
|||||||
|
|
||||||
Removes all non running containers`)
|
Removes all non running containers`)
|
||||||
pruneCommand = &cobra.Command{
|
pruneCommand = &cobra.Command{
|
||||||
Use: "prune [flags]",
|
Use: "prune [options]",
|
||||||
Short: "Remove all non running containers",
|
Short: "Remove all non running containers",
|
||||||
Long: pruneDescription,
|
Long: pruneDescription,
|
||||||
RunE: prune,
|
RunE: prune,
|
||||||
|
@ -27,7 +27,7 @@ import (
|
|||||||
var (
|
var (
|
||||||
psDescription = "Prints out information about the containers"
|
psDescription = "Prints out information about the containers"
|
||||||
psCommand = &cobra.Command{
|
psCommand = &cobra.Command{
|
||||||
Use: "ps",
|
Use: "ps [options]",
|
||||||
Args: validate.NoArgs,
|
Args: validate.NoArgs,
|
||||||
Short: "List containers",
|
Short: "List containers",
|
||||||
Long: psDescription,
|
Long: psDescription,
|
||||||
|
@ -20,7 +20,7 @@ var (
|
|||||||
A timeout before forcibly stopping can be set, but defaults to %d seconds.`, containerConfig.Engine.StopTimeout)
|
A timeout before forcibly stopping can be set, but defaults to %d seconds.`, containerConfig.Engine.StopTimeout)
|
||||||
|
|
||||||
restartCommand = &cobra.Command{
|
restartCommand = &cobra.Command{
|
||||||
Use: "restart [flags] CONTAINER [CONTAINER...]",
|
Use: "restart [options] CONTAINER [CONTAINER...]",
|
||||||
Short: "Restart one or more containers",
|
Short: "Restart one or more containers",
|
||||||
Long: restartDescription,
|
Long: restartDescription,
|
||||||
RunE: restart,
|
RunE: restart,
|
||||||
|
@ -20,7 +20,7 @@ var (
|
|||||||
Restores a container from a checkpoint. The container name or ID can be used.
|
Restores a container from a checkpoint. The container name or ID can be used.
|
||||||
`
|
`
|
||||||
restoreCommand = &cobra.Command{
|
restoreCommand = &cobra.Command{
|
||||||
Use: "restore [flags] CONTAINER [CONTAINER...]",
|
Use: "restore [options] CONTAINER [CONTAINER...]",
|
||||||
Short: "Restores one or more containers from a checkpoint",
|
Short: "Restores one or more containers from a checkpoint",
|
||||||
Long: restoreDescription,
|
Long: restoreDescription,
|
||||||
RunE: restore,
|
RunE: restore,
|
||||||
|
@ -21,7 +21,7 @@ var (
|
|||||||
|
|
||||||
Command does not remove images. Running or unusable containers will not be removed without the -f option.`
|
Command does not remove images. Running or unusable containers will not be removed without the -f option.`
|
||||||
rmCommand = &cobra.Command{
|
rmCommand = &cobra.Command{
|
||||||
Use: "rm [flags] CONTAINER [CONTAINER...]",
|
Use: "rm [options] CONTAINER [CONTAINER...]",
|
||||||
Short: "Remove one or more containers",
|
Short: "Remove one or more containers",
|
||||||
Long: rmDescription,
|
Long: rmDescription,
|
||||||
RunE: rm,
|
RunE: rm,
|
||||||
|
@ -25,7 +25,7 @@ var (
|
|||||||
runDescription = "Runs a command in a new container from the given image"
|
runDescription = "Runs a command in a new container from the given image"
|
||||||
runCommand = &cobra.Command{
|
runCommand = &cobra.Command{
|
||||||
Args: cobra.MinimumNArgs(1),
|
Args: cobra.MinimumNArgs(1),
|
||||||
Use: "run [flags] IMAGE [COMMAND [ARG...]]",
|
Use: "run [options] IMAGE [COMMAND [ARG...]]",
|
||||||
Short: "Run a command in a new container",
|
Short: "Run a command in a new container",
|
||||||
Long: runDescription,
|
Long: runDescription,
|
||||||
RunE: run,
|
RunE: run,
|
||||||
|
@ -24,7 +24,7 @@ var (
|
|||||||
runlabelOptions = runlabelOptionsWrapper{}
|
runlabelOptions = runlabelOptionsWrapper{}
|
||||||
runlabelDescription = "Executes a command as described by a container image label."
|
runlabelDescription = "Executes a command as described by a container image label."
|
||||||
runlabelCommand = &cobra.Command{
|
runlabelCommand = &cobra.Command{
|
||||||
Use: "runlabel [flags] LABEL IMAGE [ARG...]",
|
Use: "runlabel [options] LABEL IMAGE [ARG...]",
|
||||||
Short: "Execute the command described by an image label",
|
Short: "Execute the command described by an image label",
|
||||||
Long: runlabelDescription,
|
Long: runlabelDescription,
|
||||||
RunE: runlabel,
|
RunE: runlabel,
|
||||||
|
@ -17,7 +17,7 @@ import (
|
|||||||
var (
|
var (
|
||||||
startDescription = `Starts one or more containers. The container name or ID can be used.`
|
startDescription = `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 [options] CONTAINER [CONTAINER...]",
|
||||||
Short: "Start one or more containers",
|
Short: "Start one or more containers",
|
||||||
Long: startDescription,
|
Long: startDescription,
|
||||||
RunE: start,
|
RunE: start,
|
||||||
|
@ -26,7 +26,7 @@ import (
|
|||||||
var (
|
var (
|
||||||
statsDescription = "Display percentage of CPU, memory, network I/O, block I/O and PIDs for one or more containers."
|
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...]",
|
Use: "stats [options] [CONTAINER...]",
|
||||||
Short: "Display a live stream of container resource usage statistics",
|
Short: "Display a live stream of container resource usage statistics",
|
||||||
Long: statsDescription,
|
Long: statsDescription,
|
||||||
RunE: stats,
|
RunE: stats,
|
||||||
|
@ -17,7 +17,7 @@ var (
|
|||||||
|
|
||||||
A timeout to forcibly stop the container can also be set but defaults to %d seconds otherwise.`, containerConfig.Engine.StopTimeout)
|
A timeout to forcibly stop the container can also be set but defaults to %d seconds otherwise.`, containerConfig.Engine.StopTimeout)
|
||||||
stopCommand = &cobra.Command{
|
stopCommand = &cobra.Command{
|
||||||
Use: "stop [flags] CONTAINER [CONTAINER...]",
|
Use: "stop [options] CONTAINER [CONTAINER...]",
|
||||||
Short: "Stop one or more containers",
|
Short: "Stop one or more containers",
|
||||||
Long: stopDescription,
|
Long: stopDescription,
|
||||||
RunE: stop,
|
RunE: stop,
|
||||||
|
@ -26,7 +26,7 @@ var (
|
|||||||
topOptions = entities.TopOptions{}
|
topOptions = entities.TopOptions{}
|
||||||
|
|
||||||
topCommand = &cobra.Command{
|
topCommand = &cobra.Command{
|
||||||
Use: "top [flags] CONTAINER [FORMAT-DESCRIPTORS|ARGS...]",
|
Use: "top [options] CONTAINER [FORMAT-DESCRIPTORS|ARGS...]",
|
||||||
Short: "Display the running processes of a container",
|
Short: "Display the running processes of a container",
|
||||||
Long: topDescription,
|
Long: topDescription,
|
||||||
RunE: top,
|
RunE: top,
|
||||||
|
@ -19,7 +19,7 @@ var (
|
|||||||
An unmount can be forced with the --force flag.
|
An unmount can be forced with the --force flag.
|
||||||
`
|
`
|
||||||
unmountCommand = &cobra.Command{
|
unmountCommand = &cobra.Command{
|
||||||
Use: "unmount [flags] CONTAINER [CONTAINER...]",
|
Use: "unmount [options] CONTAINER [CONTAINER...]",
|
||||||
Aliases: []string{"umount"},
|
Aliases: []string{"umount"},
|
||||||
Short: "Unmounts working container's root filesystem",
|
Short: "Unmounts working container's root filesystem",
|
||||||
Long: description,
|
Long: description,
|
||||||
|
@ -17,7 +17,7 @@ import (
|
|||||||
var (
|
var (
|
||||||
unpauseDescription = `Unpauses one or more previously paused containers. The container name or ID can be used.`
|
unpauseDescription = `Unpauses one or more previously paused containers. The container name or ID can be used.`
|
||||||
unpauseCommand = &cobra.Command{
|
unpauseCommand = &cobra.Command{
|
||||||
Use: "unpause [flags] CONTAINER [CONTAINER...]",
|
Use: "unpause [options] CONTAINER [CONTAINER...]",
|
||||||
Short: "Unpause the processes in one or more containers",
|
Short: "Unpause the processes in one or more containers",
|
||||||
Long: unpauseDescription,
|
Long: unpauseDescription,
|
||||||
RunE: unpause,
|
RunE: unpause,
|
||||||
|
@ -19,7 +19,7 @@ var (
|
|||||||
waitDescription = `Block until one or more containers stop and then print their exit codes.
|
waitDescription = `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 [options] CONTAINER [CONTAINER...]",
|
||||||
Short: "Block on one or more containers",
|
Short: "Block on one or more containers",
|
||||||
Long: waitDescription,
|
Long: waitDescription,
|
||||||
RunE: wait,
|
RunE: wait,
|
||||||
|
@ -17,7 +17,7 @@ var (
|
|||||||
// Command: podman _diff_ Object_ID
|
// Command: podman _diff_ Object_ID
|
||||||
diffDescription = `Displays changes on a container or image's filesystem. The container or image will be compared to its parent layer.`
|
diffDescription = `Displays changes on a container or image's filesystem. The container or image will be compared to its parent layer.`
|
||||||
diffCmd = &cobra.Command{
|
diffCmd = &cobra.Command{
|
||||||
Use: "diff [flags] {CONTAINER_ID | IMAGE_ID}",
|
Use: "diff [options] {CONTAINER_ID | IMAGE_ID}",
|
||||||
Args: validate.IDOrLatestArgs,
|
Args: validate.IDOrLatestArgs,
|
||||||
Short: "Display the changes to the object's file system",
|
Short: "Display the changes to the object's file system",
|
||||||
Long: diffDescription,
|
Long: diffDescription,
|
||||||
|
@ -20,7 +20,7 @@ var (
|
|||||||
Whether the input is for a container or pod, Podman will always generate the specification as a pod.`
|
Whether the input is for a container or pod, Podman will always generate the specification as a pod.`
|
||||||
|
|
||||||
kubeCmd = &cobra.Command{
|
kubeCmd = &cobra.Command{
|
||||||
Use: "kube [flags] CONTAINER | POD",
|
Use: "kube [options] CONTAINER | POD",
|
||||||
Short: "Generate Kubernetes YAML from a container or pod.",
|
Short: "Generate Kubernetes YAML from a container or pod.",
|
||||||
Long: kubeDescription,
|
Long: kubeDescription,
|
||||||
RunE: kube,
|
RunE: kube,
|
||||||
|
@ -24,7 +24,7 @@ var (
|
|||||||
The generated units can later be controlled via systemctl(1).`
|
The generated units can later be controlled via systemctl(1).`
|
||||||
|
|
||||||
systemdCmd = &cobra.Command{
|
systemdCmd = &cobra.Command{
|
||||||
Use: "systemd [flags] CTR|POD",
|
Use: "systemd [options] CTR|POD",
|
||||||
Short: "Generate systemd units.",
|
Short: "Generate systemd units.",
|
||||||
Long: systemdDescription,
|
Long: systemdDescription,
|
||||||
RunE: systemd,
|
RunE: systemd,
|
||||||
|
@ -40,7 +40,7 @@ var (
|
|||||||
// Command: podman _diff_ Object_ID
|
// Command: podman _diff_ Object_ID
|
||||||
buildDescription = "Builds an OCI or Docker image using instructions from one or more Containerfiles and a specified build context directory."
|
buildDescription = "Builds an OCI or Docker image using instructions from one or more Containerfiles and a specified build context directory."
|
||||||
buildCmd = &cobra.Command{
|
buildCmd = &cobra.Command{
|
||||||
Use: "build [flags] [CONTEXT]",
|
Use: "build [options] [CONTEXT]",
|
||||||
Short: "Build an image using instructions from Containerfiles",
|
Short: "Build an image using instructions from Containerfiles",
|
||||||
Long: buildDescription,
|
Long: buildDescription,
|
||||||
Args: cobra.MaximumNArgs(1),
|
Args: cobra.MaximumNArgs(1),
|
||||||
|
@ -13,7 +13,7 @@ import (
|
|||||||
var (
|
var (
|
||||||
// podman container _inspect_
|
// podman container _inspect_
|
||||||
diffCmd = &cobra.Command{
|
diffCmd = &cobra.Command{
|
||||||
Use: "diff [flags] IMAGE",
|
Use: "diff [options] IMAGE",
|
||||||
Args: cobra.ExactArgs(1),
|
Args: cobra.ExactArgs(1),
|
||||||
Short: "Inspect changes to the image's file systems",
|
Short: "Inspect changes to the image's file systems",
|
||||||
Long: `Displays changes to the image's filesystem. The image will be compared to its parent layer.`,
|
Long: `Displays changes to the image's filesystem. The image will be compared to its parent layer.`,
|
||||||
|
@ -27,7 +27,7 @@ var (
|
|||||||
|
|
||||||
// podman _history_
|
// podman _history_
|
||||||
historyCmd = &cobra.Command{
|
historyCmd = &cobra.Command{
|
||||||
Use: "history [flags] IMAGE",
|
Use: "history [options] IMAGE",
|
||||||
Short: "Show history of a specified image",
|
Short: "Show history of a specified image",
|
||||||
Long: long,
|
Long: long,
|
||||||
Args: cobra.ExactArgs(1),
|
Args: cobra.ExactArgs(1),
|
||||||
|
@ -19,7 +19,7 @@ var (
|
|||||||
Note remote tar balls can be specified, via web address.
|
Note remote tar balls can be specified, via web address.
|
||||||
Optionally tag the image. You can specify the instructions using the --change option.`
|
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 [options] PATH [REFERENCE]",
|
||||||
Short: "Import a tarball to create a filesystem image",
|
Short: "Import a tarball to create a filesystem image",
|
||||||
Long: importDescription,
|
Long: importDescription,
|
||||||
RunE: importCon,
|
RunE: importCon,
|
||||||
|
@ -10,7 +10,7 @@ import (
|
|||||||
var (
|
var (
|
||||||
// Command: podman image _inspect_
|
// Command: podman image _inspect_
|
||||||
inspectCmd = &cobra.Command{
|
inspectCmd = &cobra.Command{
|
||||||
Use: "inspect [flags] IMAGE [IMAGE...]",
|
Use: "inspect [options] IMAGE [IMAGE...]",
|
||||||
Short: "Display the configuration of an image",
|
Short: "Display the configuration of an image",
|
||||||
Long: `Displays the low-level information of an image identified by name or ID.`,
|
Long: `Displays the low-level information of an image identified by name or ID.`,
|
||||||
RunE: inspectExec,
|
RunE: inspectExec,
|
||||||
|
@ -35,7 +35,7 @@ type listFlagType struct {
|
|||||||
var (
|
var (
|
||||||
// Command: podman image _list_
|
// Command: podman image _list_
|
||||||
listCmd = &cobra.Command{
|
listCmd = &cobra.Command{
|
||||||
Use: "list [flags] [IMAGE]",
|
Use: "list [options] [IMAGE]",
|
||||||
Aliases: []string{"ls"},
|
Aliases: []string{"ls"},
|
||||||
Args: cobra.MaximumNArgs(1),
|
Args: cobra.MaximumNArgs(1),
|
||||||
Short: "List images in local storage",
|
Short: "List images in local storage",
|
||||||
|
@ -22,7 +22,7 @@ import (
|
|||||||
var (
|
var (
|
||||||
loadDescription = "Loads an image from a locally stored archive (tar file) into container storage."
|
loadDescription = "Loads an image from a locally stored archive (tar file) into container storage."
|
||||||
loadCommand = &cobra.Command{
|
loadCommand = &cobra.Command{
|
||||||
Use: "load [flags] [NAME[:TAG]]",
|
Use: "load [options] [NAME[:TAG]]",
|
||||||
Short: "Load an image from container archive",
|
Short: "Load an image from container archive",
|
||||||
Long: loadDescription,
|
Long: loadDescription,
|
||||||
RunE: load,
|
RunE: load,
|
||||||
|
@ -24,7 +24,7 @@ var (
|
|||||||
`
|
`
|
||||||
|
|
||||||
mountCommand = &cobra.Command{
|
mountCommand = &cobra.Command{
|
||||||
Use: "mount [flags] [IMAGE...]",
|
Use: "mount [options] [IMAGE...]",
|
||||||
Short: "Mount an image's root filesystem",
|
Short: "Mount an image's root filesystem",
|
||||||
Long: mountDescription,
|
Long: mountDescription,
|
||||||
RunE: mount,
|
RunE: mount,
|
||||||
|
@ -19,7 +19,7 @@ var (
|
|||||||
|
|
||||||
If an image is not being used by a container, it will be removed from the system.`
|
If an image is not being used by a container, it will be removed from the system.`
|
||||||
pruneCmd = &cobra.Command{
|
pruneCmd = &cobra.Command{
|
||||||
Use: "prune",
|
Use: "prune [options]",
|
||||||
Args: validate.NoArgs,
|
Args: validate.NoArgs,
|
||||||
Short: "Remove unused images",
|
Short: "Remove unused images",
|
||||||
Long: pruneDescription,
|
Long: pruneDescription,
|
||||||
|
@ -30,7 +30,7 @@ var (
|
|||||||
|
|
||||||
// Command: podman pull
|
// Command: podman pull
|
||||||
pullCmd = &cobra.Command{
|
pullCmd = &cobra.Command{
|
||||||
Use: "pull [flags] IMAGE",
|
Use: "pull [options] IMAGE",
|
||||||
Args: cobra.ExactArgs(1),
|
Args: cobra.ExactArgs(1),
|
||||||
Short: "Pull an image from a registry",
|
Short: "Pull an image from a registry",
|
||||||
Long: pullDescription,
|
Long: pullDescription,
|
||||||
|
@ -29,7 +29,7 @@ var (
|
|||||||
|
|
||||||
// Command: podman push
|
// Command: podman push
|
||||||
pushCmd = &cobra.Command{
|
pushCmd = &cobra.Command{
|
||||||
Use: "push [flags] SOURCE [DESTINATION]",
|
Use: "push [options] SOURCE [DESTINATION]",
|
||||||
Short: "Push an image to a specified destination",
|
Short: "Push an image to a specified destination",
|
||||||
Long: pushDescription,
|
Long: pushDescription,
|
||||||
RunE: imagePush,
|
RunE: imagePush,
|
||||||
|
@ -14,7 +14,7 @@ import (
|
|||||||
var (
|
var (
|
||||||
rmDescription = "Removes one or more previously pulled or locally created images."
|
rmDescription = "Removes one or more previously pulled or locally created images."
|
||||||
rmCmd = &cobra.Command{
|
rmCmd = &cobra.Command{
|
||||||
Use: "rm [flags] IMAGE [IMAGE...]",
|
Use: "rm [options] IMAGE [IMAGE...]",
|
||||||
Short: "Removes one or more images from local storage",
|
Short: "Removes one or more images from local storage",
|
||||||
Long: rmDescription,
|
Long: rmDescription,
|
||||||
RunE: rm,
|
RunE: rm,
|
||||||
|
@ -25,7 +25,7 @@ var (
|
|||||||
saveDescription = `Save an image to docker-archive or oci-archive on the local machine. Default is docker-archive.`
|
saveDescription = `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 [IMAGE...]",
|
Use: "save [options] IMAGE [IMAGE...]",
|
||||||
Short: "Save image(s) to an archive",
|
Short: "Save image(s) to an archive",
|
||||||
Long: saveDescription,
|
Long: saveDescription,
|
||||||
RunE: save,
|
RunE: save,
|
||||||
|
@ -32,7 +32,7 @@ var (
|
|||||||
|
|
||||||
// Command: podman search
|
// Command: podman search
|
||||||
searchCmd = &cobra.Command{
|
searchCmd = &cobra.Command{
|
||||||
Use: "search [flags] TERM",
|
Use: "search [options] TERM",
|
||||||
Short: "Search registry for image",
|
Short: "Search registry for image",
|
||||||
Long: searchDescription,
|
Long: searchDescription,
|
||||||
RunE: imageSearch,
|
RunE: imageSearch,
|
||||||
|
@ -12,7 +12,7 @@ import (
|
|||||||
var (
|
var (
|
||||||
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 [options] IMAGE [IMAGE...]",
|
||||||
Short: "Sign an image",
|
Short: "Sign an image",
|
||||||
Long: signDescription,
|
Long: signDescription,
|
||||||
RunE: sign,
|
RunE: sign,
|
||||||
|
@ -11,7 +11,7 @@ import (
|
|||||||
var (
|
var (
|
||||||
treeDescription = "Prints layer hierarchy of an image in a tree format"
|
treeDescription = "Prints layer hierarchy of an image in a tree format"
|
||||||
treeCmd = &cobra.Command{
|
treeCmd = &cobra.Command{
|
||||||
Use: "tree [flags] IMAGE",
|
Use: "tree [options] IMAGE",
|
||||||
Args: cobra.ExactArgs(1),
|
Args: cobra.ExactArgs(1),
|
||||||
Short: treeDescription,
|
Short: treeDescription,
|
||||||
Long: treeDescription,
|
Long: treeDescription,
|
||||||
|
@ -12,7 +12,7 @@ import (
|
|||||||
var (
|
var (
|
||||||
setTrustDescription = "Set default trust policy or add a new trust policy for a registry"
|
setTrustDescription = "Set default trust policy or add a new trust policy for a registry"
|
||||||
setTrustCommand = &cobra.Command{
|
setTrustCommand = &cobra.Command{
|
||||||
Use: "set [flags] REGISTRY",
|
Use: "set [options] REGISTRY",
|
||||||
Short: "Set default trust policy or a new trust policy for a registry",
|
Short: "Set default trust policy or a new trust policy for a registry",
|
||||||
Long: setTrustDescription,
|
Long: setTrustDescription,
|
||||||
Example: "",
|
Example: "",
|
||||||
|
@ -14,7 +14,7 @@ import (
|
|||||||
var (
|
var (
|
||||||
showTrustDescription = "Display trust policy for the system"
|
showTrustDescription = "Display trust policy for the system"
|
||||||
showTrustCommand = &cobra.Command{
|
showTrustCommand = &cobra.Command{
|
||||||
Use: "show [flags] [REGISTRY]",
|
Use: "show [options] [REGISTRY]",
|
||||||
Short: "Display trust policy for the system",
|
Short: "Display trust policy for the system",
|
||||||
Long: showTrustDescription,
|
Long: showTrustDescription,
|
||||||
RunE: showTrust,
|
RunE: showTrust,
|
||||||
|
@ -19,7 +19,7 @@ var (
|
|||||||
An unmount can be forced with the --force flag.
|
An unmount can be forced with the --force flag.
|
||||||
`
|
`
|
||||||
unmountCommand = &cobra.Command{
|
unmountCommand = &cobra.Command{
|
||||||
Use: "unmount [flags] IMAGE [IMAGE...]",
|
Use: "unmount [options] IMAGE [IMAGE...]",
|
||||||
Aliases: []string{"umount"},
|
Aliases: []string{"umount"},
|
||||||
Short: "Unmount an image's root filesystem",
|
Short: "Unmount an image's root filesystem",
|
||||||
Long: description,
|
Long: description,
|
||||||
|
@ -19,7 +19,7 @@ var (
|
|||||||
|
|
||||||
// Command: podman _inspect_ Object_ID
|
// Command: podman _inspect_ Object_ID
|
||||||
inspectCmd = &cobra.Command{
|
inspectCmd = &cobra.Command{
|
||||||
Use: "inspect [flags] {CONTAINER_ID | IMAGE_ID} [...]",
|
Use: "inspect [options] {CONTAINER_ID | IMAGE_ID} [...]",
|
||||||
Short: "Display the configuration of object denoted by ID",
|
Short: "Display the configuration of object denoted by ID",
|
||||||
RunE: inspectExec,
|
RunE: inspectExec,
|
||||||
Long: inspectDescription,
|
Long: inspectDescription,
|
||||||
|
@ -20,7 +20,7 @@ type loginOptionsWrapper struct {
|
|||||||
var (
|
var (
|
||||||
loginOptions = loginOptionsWrapper{}
|
loginOptions = loginOptionsWrapper{}
|
||||||
loginCommand = &cobra.Command{
|
loginCommand = &cobra.Command{
|
||||||
Use: "login [flags] [REGISTRY]",
|
Use: "login [options] [REGISTRY]",
|
||||||
Short: "Login to a container registry",
|
Short: "Login to a container registry",
|
||||||
Long: "Login to a container registry on a specified server.",
|
Long: "Login to a container registry on a specified server.",
|
||||||
RunE: login,
|
RunE: login,
|
||||||
|
@ -14,7 +14,7 @@ import (
|
|||||||
var (
|
var (
|
||||||
logoutOptions = auth.LogoutOptions{}
|
logoutOptions = auth.LogoutOptions{}
|
||||||
logoutCommand = &cobra.Command{
|
logoutCommand = &cobra.Command{
|
||||||
Use: "logout [flags] [REGISTRY]",
|
Use: "logout [options] [REGISTRY]",
|
||||||
Short: "Logout of a container registry",
|
Short: "Logout of a container registry",
|
||||||
Long: "Remove the cached username and password for the registry.",
|
Long: "Remove the cached username and password for the registry.",
|
||||||
RunE: logout,
|
RunE: logout,
|
||||||
|
@ -66,6 +66,7 @@ func main() {
|
|||||||
// - rootCmd uses cobra default template not ours
|
// - rootCmd uses cobra default template not ours
|
||||||
c.Command.SetHelpTemplate(helpTemplate)
|
c.Command.SetHelpTemplate(helpTemplate)
|
||||||
c.Command.SetUsageTemplate(usageTemplate)
|
c.Command.SetUsageTemplate(usageTemplate)
|
||||||
|
c.Command.DisableFlagsInUseLine = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -25,7 +25,7 @@ type manifestAddOptsWrapper struct {
|
|||||||
var (
|
var (
|
||||||
manifestAddOpts = manifestAddOptsWrapper{}
|
manifestAddOpts = manifestAddOptsWrapper{}
|
||||||
addCmd = &cobra.Command{
|
addCmd = &cobra.Command{
|
||||||
Use: "add [flags] LIST LIST",
|
Use: "add [options] LIST LIST",
|
||||||
Short: "Add images to a manifest list or image index",
|
Short: "Add images to a manifest list or image index",
|
||||||
Long: "Adds an image to a manifest list or image index.",
|
Long: "Adds an image to a manifest list or image index.",
|
||||||
RunE: add,
|
RunE: add,
|
||||||
|
@ -13,7 +13,7 @@ import (
|
|||||||
var (
|
var (
|
||||||
manifestAnnotateOpts = entities.ManifestAnnotateOptions{}
|
manifestAnnotateOpts = entities.ManifestAnnotateOptions{}
|
||||||
annotateCmd = &cobra.Command{
|
annotateCmd = &cobra.Command{
|
||||||
Use: "annotate [flags] LIST IMAGE",
|
Use: "annotate [options] LIST IMAGE",
|
||||||
Short: "Add or update information about an entry in a manifest list or image index",
|
Short: "Add or update information about an entry in a manifest list or image index",
|
||||||
Long: "Adds or updates information about an entry in a manifest list or image index.",
|
Long: "Adds or updates information about an entry in a manifest list or image index.",
|
||||||
RunE: annotate,
|
RunE: annotate,
|
||||||
|
@ -13,7 +13,7 @@ import (
|
|||||||
var (
|
var (
|
||||||
manifestCreateOpts = entities.ManifestCreateOptions{}
|
manifestCreateOpts = entities.ManifestCreateOptions{}
|
||||||
createCmd = &cobra.Command{
|
createCmd = &cobra.Command{
|
||||||
Use: "create [flags] LIST [IMAGE]",
|
Use: "create [options] LIST [IMAGE]",
|
||||||
Short: "Create manifest list or image index",
|
Short: "Create manifest list or image index",
|
||||||
Long: "Creates manifest lists or image indexes.",
|
Long: "Creates manifest lists or image indexes.",
|
||||||
RunE: create,
|
RunE: create,
|
||||||
|
@ -22,7 +22,7 @@ type manifestPushOptsWrapper struct {
|
|||||||
var (
|
var (
|
||||||
manifestPushOpts = manifestPushOptsWrapper{}
|
manifestPushOpts = manifestPushOptsWrapper{}
|
||||||
pushCmd = &cobra.Command{
|
pushCmd = &cobra.Command{
|
||||||
Use: "push [flags] SOURCE DESTINATION",
|
Use: "push [options] SOURCE DESTINATION",
|
||||||
Short: "Push a manifest list or image index to a registry",
|
Short: "Push a manifest list or image index to a registry",
|
||||||
Long: "Pushes manifest lists and image indexes to registries.",
|
Long: "Pushes manifest lists and image indexes to registries.",
|
||||||
RunE: push,
|
RunE: push,
|
||||||
|
@ -14,7 +14,7 @@ import (
|
|||||||
var (
|
var (
|
||||||
networkCreateDescription = `create CNI networks for containers and pods`
|
networkCreateDescription = `create CNI networks for containers and pods`
|
||||||
networkCreateCommand = &cobra.Command{
|
networkCreateCommand = &cobra.Command{
|
||||||
Use: "create [flags] [NETWORK]",
|
Use: "create [options] [NETWORK]",
|
||||||
Short: "network create",
|
Short: "network create",
|
||||||
Long: networkCreateDescription,
|
Long: networkCreateDescription,
|
||||||
RunE: networkCreate,
|
RunE: networkCreate,
|
||||||
|
@ -17,7 +17,7 @@ import (
|
|||||||
var (
|
var (
|
||||||
networkinspectDescription = `Inspect network`
|
networkinspectDescription = `Inspect network`
|
||||||
networkinspectCommand = &cobra.Command{
|
networkinspectCommand = &cobra.Command{
|
||||||
Use: "inspect [flags] NETWORK [NETWORK...]",
|
Use: "inspect [options] NETWORK [NETWORK...]",
|
||||||
Short: "network inspect",
|
Short: "network inspect",
|
||||||
Long: networkinspectDescription,
|
Long: networkinspectDescription,
|
||||||
RunE: networkInspect,
|
RunE: networkInspect,
|
||||||
|
@ -19,7 +19,7 @@ import (
|
|||||||
var (
|
var (
|
||||||
networklistDescription = `List networks`
|
networklistDescription = `List networks`
|
||||||
networklistCommand = &cobra.Command{
|
networklistCommand = &cobra.Command{
|
||||||
Use: "ls",
|
Use: "ls [options]",
|
||||||
Args: validate.NoArgs,
|
Args: validate.NoArgs,
|
||||||
Short: "network list",
|
Short: "network list",
|
||||||
Long: networklistDescription,
|
Long: networklistDescription,
|
||||||
|
@ -16,7 +16,7 @@ import (
|
|||||||
var (
|
var (
|
||||||
networkrmDescription = `Remove networks`
|
networkrmDescription = `Remove networks`
|
||||||
networkrmCommand = &cobra.Command{
|
networkrmCommand = &cobra.Command{
|
||||||
Use: "rm [flags] NETWORK [NETWORK...]",
|
Use: "rm [options] NETWORK [NETWORK...]",
|
||||||
Short: "network rm",
|
Short: "network rm",
|
||||||
Long: networkrmDescription,
|
Long: networkrmDescription,
|
||||||
RunE: networkRm,
|
RunE: networkRm,
|
||||||
|
@ -32,7 +32,7 @@ var (
|
|||||||
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.`
|
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.`
|
||||||
|
|
||||||
kubeCmd = &cobra.Command{
|
kubeCmd = &cobra.Command{
|
||||||
Use: "kube [flags] KUBEFILE",
|
Use: "kube [options] KUBEFILE",
|
||||||
Short: "Play a pod based on Kubernetes YAML.",
|
Short: "Play a pod based on Kubernetes YAML.",
|
||||||
Long: kubeDescription,
|
Long: kubeDescription,
|
||||||
RunE: kube,
|
RunE: kube,
|
||||||
|
@ -27,7 +27,7 @@ var (
|
|||||||
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'.`
|
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'.`
|
||||||
|
|
||||||
createCommand = &cobra.Command{
|
createCommand = &cobra.Command{
|
||||||
Use: "create",
|
Use: "create [options]",
|
||||||
Args: validate.NoArgs,
|
Args: validate.NoArgs,
|
||||||
Short: "Create a new empty pod",
|
Short: "Create a new empty pod",
|
||||||
Long: podCreateDescription,
|
Long: podCreateDescription,
|
||||||
|
@ -26,7 +26,7 @@ var (
|
|||||||
By default, this will render all results in a JSON array.`)
|
By default, this will render all results in a JSON array.`)
|
||||||
|
|
||||||
inspectCmd = &cobra.Command{
|
inspectCmd = &cobra.Command{
|
||||||
Use: "inspect [flags] POD [POD...]",
|
Use: "inspect [options] POD [POD...]",
|
||||||
Short: "Displays a pod configuration",
|
Short: "Displays a pod configuration",
|
||||||
Long: inspectDescription,
|
Long: inspectDescription,
|
||||||
RunE: inspect,
|
RunE: inspect,
|
||||||
|
@ -16,7 +16,7 @@ var (
|
|||||||
|
|
||||||
The default signal is SIGKILL, or any signal specified with option --signal.`
|
The default signal is SIGKILL, or any signal specified with option --signal.`
|
||||||
killCommand = &cobra.Command{
|
killCommand = &cobra.Command{
|
||||||
Use: "kill [flags] POD [POD...]",
|
Use: "kill [options] 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,
|
||||||
RunE: kill,
|
RunE: kill,
|
||||||
|
@ -16,7 +16,7 @@ var (
|
|||||||
|
|
||||||
All running containers within each specified pod will then be paused.`
|
All running containers within each specified pod will then be paused.`
|
||||||
pauseCommand = &cobra.Command{
|
pauseCommand = &cobra.Command{
|
||||||
Use: "pause [flags] POD [POD...]",
|
Use: "pause [options] POD [POD...]",
|
||||||
Short: "Pause one or more pods",
|
Short: "Pause one or more pods",
|
||||||
Long: podPauseDescription,
|
Long: podPauseDescription,
|
||||||
RunE: pause,
|
RunE: pause,
|
||||||
|
@ -23,7 +23,7 @@ var (
|
|||||||
pruneDescription = fmt.Sprintf(`podman pod prune Removes all exited pods`)
|
pruneDescription = fmt.Sprintf(`podman pod prune Removes all exited pods`)
|
||||||
|
|
||||||
pruneCommand = &cobra.Command{
|
pruneCommand = &cobra.Command{
|
||||||
Use: "prune [flags]",
|
Use: "prune [options]",
|
||||||
Args: validate.NoArgs,
|
Args: validate.NoArgs,
|
||||||
Short: "Remove all stopped pods and their containers",
|
Short: "Remove all stopped pods and their containers",
|
||||||
Long: pruneDescription,
|
Long: pruneDescription,
|
||||||
|
@ -25,7 +25,7 @@ var (
|
|||||||
|
|
||||||
// Command: podman pod _ps_
|
// Command: podman pod _ps_
|
||||||
psCmd = &cobra.Command{
|
psCmd = &cobra.Command{
|
||||||
Use: "ps",
|
Use: "ps [options]",
|
||||||
Aliases: []string{"ls", "list"},
|
Aliases: []string{"ls", "list"},
|
||||||
Short: "List pods",
|
Short: "List pods",
|
||||||
Long: psDescription,
|
Long: psDescription,
|
||||||
|
@ -16,7 +16,7 @@ var (
|
|||||||
|
|
||||||
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.`
|
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.`
|
||||||
restartCommand = &cobra.Command{
|
restartCommand = &cobra.Command{
|
||||||
Use: "restart [flags] POD [POD...]",
|
Use: "restart [options] POD [POD...]",
|
||||||
Short: "Restart one or more pods",
|
Short: "Restart one or more pods",
|
||||||
Long: podRestartDescription,
|
Long: podRestartDescription,
|
||||||
RunE: restart,
|
RunE: restart,
|
||||||
|
@ -28,7 +28,7 @@ var (
|
|||||||
|
|
||||||
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.`)
|
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.`)
|
||||||
rmCommand = &cobra.Command{
|
rmCommand = &cobra.Command{
|
||||||
Use: "rm [flags] POD [POD...]",
|
Use: "rm [options] POD [POD...]",
|
||||||
Short: "Remove one or more pods",
|
Short: "Remove one or more pods",
|
||||||
Long: podRmDescription,
|
Long: podRmDescription,
|
||||||
RunE: rm,
|
RunE: rm,
|
||||||
|
@ -24,7 +24,7 @@ var (
|
|||||||
|
|
||||||
All containers defined in the pod will be started.`
|
All containers defined in the pod will be started.`
|
||||||
startCommand = &cobra.Command{
|
startCommand = &cobra.Command{
|
||||||
Use: "start [flags] POD [POD...]",
|
Use: "start [options] POD [POD...]",
|
||||||
Short: "Start one or more pods",
|
Short: "Start one or more pods",
|
||||||
Long: podStartDescription,
|
Long: podStartDescription,
|
||||||
RunE: start,
|
RunE: start,
|
||||||
|
@ -33,7 +33,7 @@ var (
|
|||||||
statsDescription = `Display the containers' resource-usage statistics of one or more running pod`
|
statsDescription = `Display the containers' resource-usage statistics of one or more running pod`
|
||||||
// Command: podman pod _pod_
|
// Command: podman pod _pod_
|
||||||
statsCmd = &cobra.Command{
|
statsCmd = &cobra.Command{
|
||||||
Use: "stats [flags] [POD...]",
|
Use: "stats [options] [POD...]",
|
||||||
Short: "Display a live stream of resource usage statistics for the containers in one or more pods",
|
Short: "Display a live stream of resource usage statistics for the containers in one or more pods",
|
||||||
Long: statsDescription,
|
Long: statsDescription,
|
||||||
RunE: stats,
|
RunE: stats,
|
||||||
|
@ -29,7 +29,7 @@ var (
|
|||||||
This command will stop all running containers in each of the specified pods.`
|
This command will stop all running containers in each of the specified pods.`
|
||||||
|
|
||||||
stopCommand = &cobra.Command{
|
stopCommand = &cobra.Command{
|
||||||
Use: "stop [flags] POD [POD...]",
|
Use: "stop [options] POD [POD...]",
|
||||||
Short: "Stop one or more pods",
|
Short: "Stop one or more pods",
|
||||||
Long: podStopDescription,
|
Long: podStopDescription,
|
||||||
RunE: stop,
|
RunE: stop,
|
||||||
|
@ -23,7 +23,7 @@ var (
|
|||||||
topOptions = entities.PodTopOptions{}
|
topOptions = entities.PodTopOptions{}
|
||||||
|
|
||||||
topCommand = &cobra.Command{
|
topCommand = &cobra.Command{
|
||||||
Use: "top [flags] POD [FORMAT-DESCRIPTORS|ARGS...]",
|
Use: "top [options] POD [FORMAT-DESCRIPTORS|ARGS...]",
|
||||||
Short: "Display the running processes of containers in a pod",
|
Short: "Display the running processes of containers in a pod",
|
||||||
Long: topDescription,
|
Long: topDescription,
|
||||||
RunE: top,
|
RunE: top,
|
||||||
|
@ -16,7 +16,7 @@ var (
|
|||||||
|
|
||||||
The pod name or ID can be used.`
|
The pod name or ID can be used.`
|
||||||
unpauseCommand = &cobra.Command{
|
unpauseCommand = &cobra.Command{
|
||||||
Use: "unpause [flags] POD [POD...]",
|
Use: "unpause [options] POD [POD...]",
|
||||||
Short: "Unpause one or more pods",
|
Short: "Unpause one or more pods",
|
||||||
Long: podUnpauseDescription,
|
Long: podUnpauseDescription,
|
||||||
RunE: unpause,
|
RunE: unpause,
|
||||||
|
@ -38,7 +38,7 @@ Description:
|
|||||||
// command should not use this.
|
// command should not use this.
|
||||||
const usageTemplate = `Usage:{{if (and .Runnable (not .HasAvailableSubCommands))}}
|
const usageTemplate = `Usage:{{if (and .Runnable (not .HasAvailableSubCommands))}}
|
||||||
{{.UseLine}}{{end}}{{if .HasAvailableSubCommands}}
|
{{.UseLine}}{{end}}{{if .HasAvailableSubCommands}}
|
||||||
{{.CommandPath}} [command]{{end}}{{if gt (len .Aliases) 0}}
|
{{.UseLine}} [command]{{end}}{{if gt (len .Aliases) 0}}
|
||||||
|
|
||||||
Aliases:
|
Aliases:
|
||||||
{{.NameAndAliases}}{{end}}{{if .HasExample}}
|
{{.NameAndAliases}}{{end}}{{if .HasExample}}
|
||||||
@ -49,24 +49,24 @@ Examples:
|
|||||||
Available Commands:{{range .Commands}}{{if (or .IsAvailableCommand (eq .Name "help"))}}
|
Available Commands:{{range .Commands}}{{if (or .IsAvailableCommand (eq .Name "help"))}}
|
||||||
{{rpad .Name .NamePadding }} {{.Short}}{{end}}{{end}}{{end}}{{if .HasAvailableLocalFlags}}
|
{{rpad .Name .NamePadding }} {{.Short}}{{end}}{{end}}{{end}}{{if .HasAvailableLocalFlags}}
|
||||||
|
|
||||||
Flags:
|
Options:
|
||||||
{{.LocalFlags.FlagUsages | trimTrailingWhitespaces}}{{end}}{{if .HasAvailableInheritedFlags}}
|
{{.LocalFlags.FlagUsages | trimTrailingWhitespaces}}{{end}}{{if .HasAvailableInheritedFlags}}
|
||||||
{{end}}
|
{{end}}
|
||||||
`
|
`
|
||||||
|
|
||||||
var (
|
var (
|
||||||
rootCmd = &cobra.Command{
|
rootCmd = &cobra.Command{
|
||||||
Use: path.Base(os.Args[0]),
|
Use: path.Base(os.Args[0]) + " [options]",
|
||||||
Long: "Manage pods, containers and images",
|
Long: "Manage pods, containers and images",
|
||||||
SilenceUsage: true,
|
SilenceUsage: true,
|
||||||
SilenceErrors: true,
|
SilenceErrors: true,
|
||||||
TraverseChildren: true,
|
TraverseChildren: true,
|
||||||
PersistentPreRunE: persistentPreRunE,
|
PersistentPreRunE: persistentPreRunE,
|
||||||
RunE: validate.SubCommandExists,
|
RunE: validate.SubCommandExists,
|
||||||
PersistentPostRunE: persistentPostRunE,
|
PersistentPostRunE: persistentPostRunE,
|
||||||
Version: version.Version.String(),
|
Version: version.Version.String(),
|
||||||
|
DisableFlagsInUseLine: true,
|
||||||
}
|
}
|
||||||
|
|
||||||
logLevels = []string{"debug", "info", "warn", "error", "fatal", "panic"}
|
logLevels = []string{"debug", "info", "warn", "error", "fatal", "panic"}
|
||||||
logLevel = "error"
|
logLevel = "error"
|
||||||
useSyslog bool
|
useSyslog bool
|
||||||
@ -81,6 +81,7 @@ func init() {
|
|||||||
)
|
)
|
||||||
|
|
||||||
rootFlags(rootCmd, registry.PodmanConfig())
|
rootFlags(rootCmd, registry.PodmanConfig())
|
||||||
|
rootCmd.SetUsageTemplate(usageTemplate)
|
||||||
}
|
}
|
||||||
|
|
||||||
func Execute() {
|
func Execute() {
|
||||||
|
@ -27,7 +27,7 @@ const schemaPattern = "^[A-Za-z][A-Za-z0-9+.-]*:"
|
|||||||
|
|
||||||
var (
|
var (
|
||||||
addCmd = &cobra.Command{
|
addCmd = &cobra.Command{
|
||||||
Use: "add [flags] NAME DESTINATION",
|
Use: "add [options] NAME DESTINATION",
|
||||||
Args: cobra.ExactArgs(2),
|
Args: cobra.ExactArgs(2),
|
||||||
Short: "Record destination for the Podman service",
|
Short: "Record destination for the Podman service",
|
||||||
Long: `Add destination to podman configuration.
|
Long: `Add destination to podman configuration.
|
||||||
|
@ -23,7 +23,7 @@ var (
|
|||||||
Show podman disk usage
|
Show podman disk usage
|
||||||
`
|
`
|
||||||
dfSystemCommand = &cobra.Command{
|
dfSystemCommand = &cobra.Command{
|
||||||
Use: "df",
|
Use: "df [options]",
|
||||||
Args: validate.NoArgs,
|
Args: validate.NoArgs,
|
||||||
Short: "Show podman disk usage",
|
Short: "Show podman disk usage",
|
||||||
Long: dfSystemDescription,
|
Long: dfSystemDescription,
|
||||||
|
@ -20,7 +20,7 @@ var (
|
|||||||
|
|
||||||
By default, streaming mode is used, printing new events as they occur. Previous events can be listed via --since and --until.`
|
By default, streaming mode is used, printing new events as they occur. Previous events can be listed via --since and --until.`
|
||||||
eventsCommand = &cobra.Command{
|
eventsCommand = &cobra.Command{
|
||||||
Use: "events",
|
Use: "events [options]",
|
||||||
Args: validate.NoArgs,
|
Args: validate.NoArgs,
|
||||||
Short: "Show podman events",
|
Short: "Show podman events",
|
||||||
Long: eventsDescription,
|
Long: eventsDescription,
|
||||||
|
@ -20,7 +20,7 @@ var (
|
|||||||
Useful for the user and when reporting issues.
|
Useful for the user and when reporting issues.
|
||||||
`
|
`
|
||||||
infoCommand = &cobra.Command{
|
infoCommand = &cobra.Command{
|
||||||
Use: "info",
|
Use: "info [options]",
|
||||||
Args: validate.NoArgs,
|
Args: validate.NoArgs,
|
||||||
Long: infoDescription,
|
Long: infoDescription,
|
||||||
Short: "Display podman system information",
|
Short: "Display podman system information",
|
||||||
|
@ -21,7 +21,7 @@ var (
|
|||||||
`
|
`
|
||||||
|
|
||||||
migrateCommand = &cobra.Command{
|
migrateCommand = &cobra.Command{
|
||||||
Use: "migrate",
|
Use: "migrate [options]",
|
||||||
Args: validate.NoArgs,
|
Args: validate.NoArgs,
|
||||||
Short: "Migrate containers",
|
Short: "Migrate containers",
|
||||||
Long: migrateDescription,
|
Long: migrateDescription,
|
||||||
|
@ -25,7 +25,7 @@ var (
|
|||||||
`)
|
`)
|
||||||
|
|
||||||
pruneCommand = &cobra.Command{
|
pruneCommand = &cobra.Command{
|
||||||
Use: "prune [flags]",
|
Use: "prune [options]",
|
||||||
Short: "Remove unused data",
|
Short: "Remove unused data",
|
||||||
Args: validate.NoArgs,
|
Args: validate.NoArgs,
|
||||||
Long: pruneDescription,
|
Long: pruneDescription,
|
||||||
|
@ -22,7 +22,7 @@ var (
|
|||||||
All containers will be stopped and removed, and all images, volumes and container content will be removed.
|
All containers will be stopped and removed, and all images, volumes and container content will be removed.
|
||||||
`
|
`
|
||||||
systemResetCommand = &cobra.Command{
|
systemResetCommand = &cobra.Command{
|
||||||
Use: "reset",
|
Use: "reset [options]",
|
||||||
Args: validate.NoArgs,
|
Args: validate.NoArgs,
|
||||||
Short: "Reset podman storage",
|
Short: "Reset podman storage",
|
||||||
Long: systemResetDescription,
|
Long: systemResetDescription,
|
||||||
|
@ -26,7 +26,7 @@ Enable a listening service for API access to Podman commands.
|
|||||||
`
|
`
|
||||||
|
|
||||||
srvCmd = &cobra.Command{
|
srvCmd = &cobra.Command{
|
||||||
Use: "service [flags] [URI]",
|
Use: "service [options] [URI]",
|
||||||
Args: cobra.MaximumNArgs(1),
|
Args: cobra.MaximumNArgs(1),
|
||||||
Short: "Run API service",
|
Short: "Run API service",
|
||||||
Long: srvDescription,
|
Long: srvDescription,
|
||||||
|
@ -16,7 +16,7 @@ var (
|
|||||||
Tools speaking varlink protocol can remotely manage pods, containers and images.
|
Tools speaking varlink protocol can remotely manage pods, containers and images.
|
||||||
`
|
`
|
||||||
varlinkCmd = &cobra.Command{
|
varlinkCmd = &cobra.Command{
|
||||||
Use: "varlink [flags] [URI]",
|
Use: "varlink [options] [URI]",
|
||||||
Args: cobra.MinimumNArgs(1),
|
Args: cobra.MinimumNArgs(1),
|
||||||
Short: "Run varlink interface",
|
Short: "Run varlink interface",
|
||||||
Long: varlinkDescription,
|
Long: varlinkDescription,
|
||||||
|
@ -19,7 +19,7 @@ import (
|
|||||||
|
|
||||||
var (
|
var (
|
||||||
versionCommand = &cobra.Command{
|
versionCommand = &cobra.Command{
|
||||||
Use: "version",
|
Use: "version [options]",
|
||||||
Args: validate.NoArgs,
|
Args: validate.NoArgs,
|
||||||
Short: "Display the Podman Version Information",
|
Short: "Display the Podman Version Information",
|
||||||
RunE: version,
|
RunE: version,
|
||||||
|
@ -15,7 +15,7 @@ var (
|
|||||||
createDescription = `If using the default driver, "local", the volume will be created on the host in the volumes directory under container storage.`
|
createDescription = `If using the default driver, "local", the volume will be created on the host in the volumes directory under container storage.`
|
||||||
|
|
||||||
createCommand = &cobra.Command{
|
createCommand = &cobra.Command{
|
||||||
Use: "create [flags] [NAME]",
|
Use: "create [options] [NAME]",
|
||||||
Short: "Create a new volume",
|
Short: "Create a new volume",
|
||||||
Long: createDescription,
|
Long: createDescription,
|
||||||
RunE: create,
|
RunE: create,
|
||||||
|
@ -19,7 +19,7 @@ var (
|
|||||||
|
|
||||||
Use a Go template to change the format from JSON.`
|
Use a Go template to change the format from JSON.`
|
||||||
inspectCommand = &cobra.Command{
|
inspectCommand = &cobra.Command{
|
||||||
Use: "inspect [flags] VOLUME [VOLUME...]",
|
Use: "inspect [options] VOLUME [VOLUME...]",
|
||||||
Short: "Display detailed information on one or more volumes",
|
Short: "Display detailed information on one or more volumes",
|
||||||
Long: volumeInspectDescription,
|
Long: volumeInspectDescription,
|
||||||
RunE: inspect,
|
RunE: inspect,
|
||||||
|
@ -24,7 +24,7 @@ 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.`
|
||||||
lsCommand = &cobra.Command{
|
lsCommand = &cobra.Command{
|
||||||
Use: "ls",
|
Use: "ls [options]",
|
||||||
Aliases: []string{"list"},
|
Aliases: []string{"list"},
|
||||||
Args: validate.NoArgs,
|
Args: validate.NoArgs,
|
||||||
Short: "List volumes",
|
Short: "List volumes",
|
||||||
|
@ -21,7 +21,7 @@ var (
|
|||||||
The command prompts for confirmation which can be overridden with the --force flag.
|
The command prompts for confirmation which can be overridden with the --force flag.
|
||||||
Note all data will be destroyed.`
|
Note all data will be destroyed.`
|
||||||
pruneCommand = &cobra.Command{
|
pruneCommand = &cobra.Command{
|
||||||
Use: "prune",
|
Use: "prune [options]",
|
||||||
Args: validate.NoArgs,
|
Args: validate.NoArgs,
|
||||||
Short: "Remove all unused volumes",
|
Short: "Remove all unused volumes",
|
||||||
Long: volumePruneDescription,
|
Long: volumePruneDescription,
|
||||||
|
@ -18,7 +18,7 @@ var (
|
|||||||
|
|
||||||
By default only volumes that are not being used by any containers will be removed. To remove the volumes anyways, use the --force flag.`
|
By default only volumes that are not being used by any containers will be removed. To remove the volumes anyways, use the --force flag.`
|
||||||
rmCommand = &cobra.Command{
|
rmCommand = &cobra.Command{
|
||||||
Use: "rm [flags] VOLUME [VOLUME...]",
|
Use: "rm [options] VOLUME [VOLUME...]",
|
||||||
Aliases: []string{"remove"},
|
Aliases: []string{"remove"},
|
||||||
Short: "Remove one or more volumes",
|
Short: "Remove one or more volumes",
|
||||||
Long: volumeRmDescription,
|
Long: volumeRmDescription,
|
||||||
|
@ -31,48 +31,48 @@ _read_podman_commands() {
|
|||||||
eval "$_var_ref=(\$_podman_commands)"
|
eval "$_var_ref=(\$_podman_commands)"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Run 'podman XX --help', set _podman_flag_list to a formatted list
|
# Run 'podman XX --help', set _podman_option_list to a formatted list
|
||||||
# of flag options for XX
|
# of option options for XX
|
||||||
_read_podman_flags() {
|
_read_podman_options() {
|
||||||
local line
|
local line
|
||||||
|
|
||||||
local _var_ref=_podman_flags_"${*// /_}"
|
local _var_ref=_podman_options_"${*// /_}"
|
||||||
eval "typeset -ga ${_var_ref}"
|
eval "typeset -ga ${_var_ref}"
|
||||||
typeset -ga _podman_flag_list
|
typeset -ga _podman_option_list
|
||||||
_podman_flag_list=(${(P)_var_ref})
|
_podman_option_list=(${(P)_var_ref})
|
||||||
(( $#_podman_flag_list )) && return
|
(( $#_podman_option_list )) && return
|
||||||
|
|
||||||
# Extract the Flags; strip leading whitespace; pack '-f, --foo'
|
# Extract the Options; strip leading whitespace; pack '-f, --foo'
|
||||||
# as '-f,--foo' (no space); then add '=' to '--foo string'.
|
# as '-f,--foo' (no space); then add '=' to '--foo string'.
|
||||||
# The result will be, e.g. '-f,--foo=string Description of Option'
|
# The result will be, e.g. '-f,--foo=string Description of Option'
|
||||||
_call_program podman podman "$@" --help |\
|
_call_program podman podman "$@" --help |\
|
||||||
sed -n -e '0,/^Flags:/d' -e '/^$/q;p' |\
|
sed -n -e '0,/^Options:/d' -e '/^$/q;p' |\
|
||||||
grep '^ \+-' |\
|
grep '^ \+-' |\
|
||||||
sed -e 's/^ *//' -e 's/^\(-.,\) --/\1--/' |\
|
sed -e 's/^ *//' -e 's/^\(-.,\) --/\1--/' |\
|
||||||
sed -e 's/^\(-[^ ]\+\) \([^ ]\+\) /\1=\2 /' |\
|
sed -e 's/^\(-[^ ]\+\) \([^ ]\+\) /\1=\2 /' |\
|
||||||
while read flags desc;do
|
while read options desc;do
|
||||||
# flags like --foo=string: split into --foo & string
|
# options like --foo=string: split into --foo & string
|
||||||
local -a tmpa
|
local -a tmpa
|
||||||
local optval=
|
local optval=
|
||||||
tmpa=(${(s.=.)flags})
|
tmpa=(${(s.=.)options})
|
||||||
if [ -n "$tmpa[2]" ]; then
|
if [ -n "$tmpa[2]" ]; then
|
||||||
flags=$tmpa[1]
|
options=$tmpa[1]
|
||||||
optval=$tmpa[2]
|
optval=$tmpa[2]
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# 'podman attach --detach-keys' includes ']' in help msg
|
# 'podman attach --detach-keys' includes ']' in help msg
|
||||||
desc=${desc//\]/\\]}
|
desc=${desc//\]/\\]}
|
||||||
|
|
||||||
for flag in ${(s:,:)flags}; do
|
for option in ${(s:,:)options}; do
|
||||||
if [ -n "$optval" ]; then
|
if [ -n "$optval" ]; then
|
||||||
_podman_flag_list+=("${flag}[$desc]:$(_podman_find_helper ${flags} ${optval} ${desc})")
|
_podman_option_list+=("${option}[$desc]:$(_podman_find_helper ${options} ${optval} ${desc})")
|
||||||
else
|
else
|
||||||
_podman_flag_list+=("${flag}[$desc]")
|
_podman_option_list+=("${option}[$desc]")
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
done
|
done
|
||||||
|
|
||||||
eval "typeset -ga $_var_ref=(\$_podman_flag_list)"
|
eval "typeset -ga $_var_ref=(\$_podman_option_list)"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Run 'podman XXX --help', set _podman_usage to the line after "Usage:"
|
# Run 'podman XXX --help', set _podman_usage to the line after "Usage:"
|
||||||
@ -95,9 +95,9 @@ _read_podman_usage() {
|
|||||||
###############################################################################
|
###############################################################################
|
||||||
# BEGIN custom helpers for individual option arguments
|
# BEGIN custom helpers for individual option arguments
|
||||||
|
|
||||||
# Find a zsh helper for a given flag or command-line option
|
# Find a zsh helper for a given option or command-line option
|
||||||
_podman_find_helper() {
|
_podman_find_helper() {
|
||||||
local flags=$1
|
local options=$1
|
||||||
local optval=$2
|
local optval=$2
|
||||||
local desc=$3
|
local desc=$3
|
||||||
local helper=
|
local helper=
|
||||||
@ -113,7 +113,7 @@ _podman_find_helper() {
|
|||||||
helper=_files
|
helper=_files
|
||||||
# For messages like 'restart policy ("always"|"no"|"on-failure")
|
# For messages like 'restart policy ("always"|"no"|"on-failure")
|
||||||
elif optlist=$(expr "$desc" : '.*(\(\"[^\\)]\+|[^\\)]\+\"\))' 2>/dev/null); then
|
elif optlist=$(expr "$desc" : '.*(\(\"[^\\)]\+|[^\\)]\+\"\))' 2>/dev/null); then
|
||||||
optval=${${flags##--}//-/ } # "--log-level" => "log level"
|
optval=${${options##--}//-/ } # "--log-level" => "log level"
|
||||||
optlist=${optlist//\"/} # "a"|"b"|"c" => a|b|c
|
optlist=${optlist//\"/} # "a"|"b"|"c" => a|b|c
|
||||||
optlist=${optlist//\|/ } # a|b|c => a b c
|
optlist=${optlist//\|/ } # a|b|c => a b c
|
||||||
# FIXME: how to present values _in order_, not sorted alphabetically?
|
# FIXME: how to present values _in order_, not sorted alphabetically?
|
||||||
@ -205,8 +205,8 @@ _set_up_podman_args() {
|
|||||||
_read_podman_usage "$@"
|
_read_podman_usage "$@"
|
||||||
|
|
||||||
typeset -ga _podman_args=()
|
typeset -ga _podman_args=()
|
||||||
# E.g. 'podman exec [flags] CONTAINER [...' -> 'CONTAINER [....'
|
# E.g. 'podman exec [options] CONTAINER [...' -> 'CONTAINER [....'
|
||||||
local usage_rhs=$(expr "$_podman_usage" : ".*\[flags\] \+\(.*\)")
|
local usage_rhs=$(expr "$_podman_usage" : ".*\[options\] \+\(.*\)")
|
||||||
|
|
||||||
# e.g. podman pod ps which takes no further args
|
# e.g. podman pod ps which takes no further args
|
||||||
if [ -z "$usage_rhs" ]; then
|
if [ -z "$usage_rhs" ]; then
|
||||||
@ -290,14 +290,14 @@ _set_up_podman_args() {
|
|||||||
# For an endpoint command, i.e. not a subcommand.
|
# For an endpoint command, i.e. not a subcommand.
|
||||||
_podman_terminus() {
|
_podman_terminus() {
|
||||||
typeset -A opt_args
|
typeset -A opt_args
|
||||||
typeset -ga _podman_flag_list
|
typeset -ga _podman_option_list
|
||||||
typeset -ga _podman_args
|
typeset -ga _podman_args
|
||||||
integer ret=1
|
integer ret=1
|
||||||
|
|
||||||
# Find out what args it takes (e.g. image(s), container(s)) and see
|
# Find out what args it takes (e.g. image(s), container(s)) and see
|
||||||
# if we have helpers for them.
|
# if we have helpers for them.
|
||||||
_set_up_podman_args "$@"
|
_set_up_podman_args "$@"
|
||||||
_arguments -C $_podman_flag_list $_podman_args && ret=0
|
_arguments -C $_podman_option_list $_podman_args && ret=0
|
||||||
|
|
||||||
return ret
|
return ret
|
||||||
}
|
}
|
||||||
@ -319,7 +319,7 @@ _podman_terminus() {
|
|||||||
# zsh first calls us with words=(podman container mount) but we don't
|
# zsh first calls us with words=(podman container mount) but we don't
|
||||||
# want all that full context yet! We want to go a piece at a time,
|
# want all that full context yet! We want to go a piece at a time,
|
||||||
# handling 'container' first, then 'mount'; ending up with our
|
# handling 'container' first, then 'mount'; ending up with our
|
||||||
# final 'podman container mount --help' giving us suitable flags
|
# final 'podman container mount --help' giving us suitable options
|
||||||
# and no subcommands; from which we determine that it's a terminus
|
# and no subcommands; from which we determine that it's a terminus
|
||||||
# and jump to a function that handles non-subcommand arguments.
|
# and jump to a function that handles non-subcommand arguments.
|
||||||
#
|
#
|
||||||
@ -333,15 +333,15 @@ _podman_subcommand() {
|
|||||||
|
|
||||||
# Run 'podman --help' / 'podman system --help' for our context (initially
|
# Run 'podman --help' / 'podman system --help' for our context (initially
|
||||||
# empty, then possibly under subcommands); from those, get a list of
|
# empty, then possibly under subcommands); from those, get a list of
|
||||||
# flags appropriate for this context and, if applicable, subcommands.
|
# options appropriate for this context and, if applicable, subcommands.
|
||||||
_read_podman_flags "$@"
|
_read_podman_options "$@"
|
||||||
_read_podman_commands "$@"
|
_read_podman_commands "$@"
|
||||||
|
|
||||||
# Now, is this a sub-subcommand, or does it have args?
|
# Now, is this a sub-subcommand, or does it have args?
|
||||||
if (( $#_podman_commands )); then
|
if (( $#_podman_commands )); then
|
||||||
# Subcommands required (podman, podman system, etc)
|
# Subcommands required (podman, podman system, etc)
|
||||||
local cmd=${words// /_}
|
local cmd=${words// /_}
|
||||||
_arguments -C $_podman_flag_list \
|
_arguments -C $_podman_option_list \
|
||||||
"(-): :->command" \
|
"(-): :->command" \
|
||||||
"(-)*:: :->option-or-argument" \
|
"(-)*:: :->option-or-argument" \
|
||||||
&& ret=0
|
&& ret=0
|
||||||
|
@ -78,7 +78,7 @@ function html_fn() {
|
|||||||
# the command name but not its description.
|
# the command name but not its description.
|
||||||
function podman_commands() {
|
function podman_commands() {
|
||||||
$PODMAN help "$@" |\
|
$PODMAN help "$@" |\
|
||||||
awk '/^Available Commands:/{ok=1;next}/^Flags:/{ok=0}ok { print $1 }' |\
|
awk '/^Available Commands:/{ok=1;next}/^Options:/{ok=0}ok { print $1 }' |\
|
||||||
grep .
|
grep .
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@ podman\-pod\-top - Display the running processes of containers in a pod
|
|||||||
**podman pod top** [*options*] *pod* [*format-descriptors*]
|
**podman pod top** [*options*] *pod* [*format-descriptors*]
|
||||||
|
|
||||||
## DESCRIPTION
|
## DESCRIPTION
|
||||||
Display the running processes of containers in a pod. The *format-descriptors* are ps (1) compatible AIX format descriptors but extended to print additional information, such as the seccomp mode or the effective capabilities of a given process. The descriptors can either be passed as separated arguments or as a single comma-separated argument. Note that you can also specify options and or flags of ps(1); in this case, Podman will fallback to executing ps with the specified arguments and flags in the container.
|
Display the running processes of containers in a pod. The *format-descriptors* are ps (1) compatible AIX format descriptors but extended to print additional information, such as the seccomp mode or the effective capabilities of a given process. The descriptors can either be passed as separated arguments or as a single comma-separated argument. Note that you can specify options and/or additionally options of ps(1); in this case, Podman will fallback to executing ps with the specified arguments and options in the container.
|
||||||
|
|
||||||
## OPTIONS
|
## OPTIONS
|
||||||
|
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user