Cleanup descriptions and help information

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>

Closes: #1167
Approved by: baude
This commit is contained in:
Daniel J Walsh
2018-07-26 16:10:46 -04:00
committed by Atomic Bot
parent c142409598
commit f9152d075a
23 changed files with 58 additions and 48 deletions

View File

@ -20,7 +20,7 @@ var (
"or more Dockerfiles and a specified build context directory." "or more Dockerfiles and a specified build context directory."
buildCommand = cli.Command{ buildCommand = cli.Command{
Name: "build", Name: "build",
Usage: "build an image using instructions from Dockerfiles", Usage: "Build an image using instructions from Dockerfiles",
Description: buildDescription, Description: buildDescription,
Flags: append(buildahcli.BudFlags, buildahcli.FromAndBudFlags...), Flags: append(buildahcli.BudFlags, buildahcli.FromAndBudFlags...),
Action: buildCmd, Action: buildCmd,

View File

@ -19,6 +19,10 @@ var (
Name: "latest, l", Name: "latest, l",
Usage: "act on the latest container podman is aware of", Usage: "act on the latest container podman is aware of",
} }
LatestPodFlag = cli.BoolFlag{
Name: "latest, l",
Usage: "act on the latest pod podman is aware of",
}
) )
const ( const (

View File

@ -38,7 +38,7 @@ var (
containerDescription = "Manage containers" containerDescription = "Manage containers"
containerCommand = cli.Command{ containerCommand = cli.Command{
Name: "container", Name: "container",
Usage: "container COMMAND", Usage: "Manage Containers",
Description: containerDescription, Description: containerDescription,
ArgsUsage: "", ArgsUsage: "",
Subcommands: subCommands, Subcommands: subCommands,

View File

@ -43,7 +43,7 @@ var createDescription = "Creates a new container from the given image or" +
var createCommand = cli.Command{ var createCommand = cli.Command{
Name: "create", Name: "create",
Usage: "create but do not start a container", Usage: "Create but do not start a container",
Description: createDescription, Description: createDescription,
Flags: createFlags, Flags: createFlags,
Action: createCmd, Action: createCmd,

View File

@ -23,7 +23,7 @@ var (
imageDescription = "Manage images" imageDescription = "Manage images"
imageCommand = cli.Command{ imageCommand = cli.Command{
Name: "image", Name: "image",
Usage: "image COMMAND", Usage: "Manage images",
Description: imageDescription, Description: imageDescription,
ArgsUsage: "", ArgsUsage: "",
Subcommands: imageSubCommands, Subcommands: imageSubCommands,

View File

@ -122,7 +122,7 @@ var (
imagesDescription = "lists locally stored images." imagesDescription = "lists locally stored images."
imagesCommand = cli.Command{ imagesCommand = cli.Command{
Name: "images", Name: "images",
Usage: "list images in local storage", Usage: "List images in local storage",
Description: imagesDescription, Description: imagesDescription,
Flags: imagesFlags, Flags: imagesFlags,
Action: imagesCmd, Action: imagesCmd,

View File

@ -11,7 +11,7 @@ import (
) )
var ( var (
infoDescription = "display system information" infoDescription = "Display podman system information"
infoCommand = cli.Command{ infoCommand = cli.Command{
Name: "info", Name: "info",
Usage: infoDescription, Usage: infoDescription,

View File

@ -32,7 +32,7 @@ var (
loadDescription = "Loads the image from docker-archive stored on the local machine." loadDescription = "Loads the image from docker-archive stored on the local machine."
loadCommand = cli.Command{ loadCommand = cli.Command{
Name: "load", Name: "load",
Usage: "load an image from docker archive", Usage: "Load an image from docker archive",
Description: loadDescription, Description: loadDescription,
Flags: loadFlags, Flags: loadFlags,
Action: loadCmd, Action: loadCmd,

View File

@ -41,7 +41,7 @@ var (
loginDescription = "Login to a container registry on a specified server." loginDescription = "Login to a container registry on a specified server."
loginCommand = cli.Command{ loginCommand = cli.Command{
Name: "login", Name: "login",
Usage: "login to a container registry", Usage: "Login to a container registry",
Description: loginDescription, Description: loginDescription,
Flags: loginFlags, Flags: loginFlags,
Action: loginCmd, Action: loginCmd,

View File

@ -23,7 +23,7 @@ var (
logoutDescription = "Remove the cached username and password for the registry." logoutDescription = "Remove the cached username and password for the registry."
logoutCommand = cli.Command{ logoutCommand = cli.Command{
Name: "logout", Name: "logout",
Usage: "logout of a container registry", Usage: "Logout of a container registry",
Description: logoutDescription, Description: logoutDescription,
Flags: logoutFlags, Flags: logoutFlags,
Action: logoutCmd, Action: logoutCmd,

View File

@ -5,18 +5,11 @@ import (
) )
var ( var (
podDescription = ` podDescription = `Manage container pods.
podman pod
Manage container pods. 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.
` `
podCommand = cli.Command{ podSubCommands = []cli.Command{
Name: "pod",
Usage: "Manage pods",
Description: podDescription,
UseShortOptionHandling: true,
Subcommands: []cli.Command{
podCreateCommand, podCreateCommand,
podKillCommand, podKillCommand,
podPsCommand, podPsCommand,
@ -24,6 +17,12 @@ var (
podRmCommand, podRmCommand,
podStartCommand, podStartCommand,
podStopCommand, podStopCommand,
}, }
podCommand = cli.Command{
Name: "pod",
Usage: "Manage pods",
Description: podDescription,
UseShortOptionHandling: true,
Subcommands: podSubCommands,
} }
) )

View File

@ -41,7 +41,7 @@ var podCreateFlags = []cli.Flag{
var podCreateCommand = cli.Command{ var podCreateCommand = cli.Command{
Name: "create", Name: "create",
Usage: "create a new empty pod", Usage: "Create a new empty pod",
Description: podCreateDescription, Description: podCreateDescription,
Flags: podCreateFlags, Flags: podCreateFlags,
Action: podCreateCmd, Action: podCreateCmd,

View File

@ -23,7 +23,7 @@ var (
Usage: "Signal to send to the containers in the pod", Usage: "Signal to send to the containers in the pod",
Value: "KILL", Value: "KILL",
}, },
LatestFlag, LatestPodFlag,
} }
podKillDescription = "The main process of each container inside the specified pod will be sent SIGKILL, or any signal specified with option --signal." podKillDescription = "The main process of each container inside the specified pod will be sent SIGKILL, or any signal specified with option --signal."
podKillCommand = cli.Command{ podKillCommand = cli.Command{

View File

@ -16,7 +16,7 @@ var (
Name: "all, a", Name: "all, a",
Usage: "restart all pods", Usage: "restart all pods",
}, },
LatestFlag, LatestPodFlag,
} }
podRestartDescription = `Restarts one or more pods. The pod ID or name can be used.` podRestartDescription = `Restarts one or more pods. The pod ID or name can be used.`

View File

@ -20,14 +20,16 @@ var (
Name: "force, f", Name: "force, f",
Usage: "Force removal of a running pod by first stopping all containers, then removing all containers in the pod. The default is false", Usage: "Force removal of a running pod by first stopping all containers, then removing all containers in the pod. The default is false",
}, },
LatestFlag, LatestPodFlag,
} }
podRmDescription = "Remove one or more pods" podRmDescription = fmt.Sprintf(`
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.
If --force is specified, all containers will be stopped, then removed.
`)
podRmCommand = cli.Command{ podRmCommand = cli.Command{
Name: "rm", Name: "rm",
Usage: fmt.Sprintf(`podman rm will remove one or more pods from the host. The pod name or ID can be used. Usage: "Remove one or more pods",
A pod with containers will not be removed without --force.
If --force is specified, all containers will be stopped, then removed.`),
Description: podRmDescription, Description: podRmDescription,
Flags: podRmFlags, Flags: podRmFlags,
Action: podRmCmd, Action: podRmCmd,

View File

@ -16,7 +16,7 @@ var (
Name: "all, a", Name: "all, a",
Usage: "start all running pods", Usage: "start all running pods",
}, },
LatestFlag, LatestPodFlag,
} }
podStartDescription = ` podStartDescription = `
podman pod start podman pod start

View File

@ -16,7 +16,7 @@ var (
Name: "all, a", Name: "all, a",
Usage: "stop all running pods", Usage: "stop all running pods",
}, },
LatestFlag, LatestPodFlag,
} }
podStopDescription = ` podStopDescription = `
podman pod stop podman pod stop

View File

@ -44,12 +44,14 @@ var (
}, },
} }
pullDescription = "Pulls an image from a registry and stores it locally.\n" + pullDescription = `
"An image can be pulled using its tag or digest. If a tag is not\n" + Pulls an image from a registry and stores it locally.
"specified, the image with the 'latest' tag (if it exists) is pulled." 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
`
pullCommand = cli.Command{ pullCommand = cli.Command{
Name: "pull", Name: "pull",
Usage: "pull an image from a registry", Usage: "Pull an image from a registry",
Description: pullDescription, Description: pullDescription,
Flags: pullFlags, Flags: pullFlags,
Action: pullCmd, Action: pullCmd,

View File

@ -68,7 +68,7 @@ var (
pushCommand = cli.Command{ pushCommand = cli.Command{
Name: "push", Name: "push",
Usage: "push an image to a specified destination", Usage: "Push an image to a specified destination",
Description: pushDescription, Description: pushDescription,
Flags: pushFlags, Flags: pushFlags,
Action: pushCmd, Action: pushCmd,

View File

@ -22,11 +22,14 @@ var (
}, },
LatestFlag, LatestFlag,
} }
rmDescription = "Remove one or more containers" rmDescription = fmt.Sprintf(`
Podman rm will remove one or more containers from the host.
The container name or ID can be used. This does not remove images.
Running containers will not be removed without the -f option.
`)
rmCommand = cli.Command{ rmCommand = cli.Command{
Name: "rm", Name: "rm",
Usage: fmt.Sprintf(`podman rm will remove one or more containers from the host. The container name or ID can be used. Usage: "Remove one or more containers",
This does not remove images. Running containers will not be removed without the -f option.`),
Description: rmDescription, Description: rmDescription,
Flags: rmFlags, Flags: rmFlags,
Action: rmCmd, Action: rmCmd,

View File

@ -12,7 +12,7 @@ import (
) )
var ( var (
rmiDescription = "removes one or more locally stored images." rmiDescription = "Removes one or more locally stored images."
rmiFlags = []cli.Flag{ rmiFlags = []cli.Flag{
cli.BoolFlag{ cli.BoolFlag{
Name: "all, a", Name: "all, a",
@ -25,7 +25,7 @@ var (
} }
rmiCommand = cli.Command{ rmiCommand = cli.Command{
Name: "rmi", Name: "rmi",
Usage: "removes one or more images from local storage", Usage: "Removes one or more images from local storage",
Description: rmiDescription, Description: rmiDescription,
Action: rmiCmd, Action: rmiCmd,
ArgsUsage: "IMAGE-NAME-OR-ID [...]", ArgsUsage: "IMAGE-NAME-OR-ID [...]",

View File

@ -29,7 +29,7 @@ var runFlags []cli.Flag = append(createFlags, cli.BoolTFlag{
var runCommand = cli.Command{ var runCommand = cli.Command{
Name: "run", Name: "run",
Usage: "run a command in a new container", Usage: "Run a command in a new container",
Description: runDescription, Description: runDescription,
Flags: runFlags, Flags: runFlags,
Action: runCmd, Action: runCmd,

View File

@ -54,7 +54,7 @@ var (
Can limit the number of results, and filter the output based on certain conditions.` Can limit the number of results, and filter the output based on certain conditions.`
searchCommand = cli.Command{ searchCommand = cli.Command{
Name: "search", Name: "search",
Usage: "search registry for image", Usage: "Search registry for image",
Description: searchDescription, Description: searchDescription,
Flags: searchFlags, Flags: searchFlags,
Action: searchCmd, Action: searchCmd,