Merge pull request #2309 from rhatdan/help
Don't show global flags except for podman command
This commit is contained in:
commit
bdf537f4fc
|
|
@ -28,6 +28,7 @@ var (
|
|||
|
||||
func init() {
|
||||
attachCommand.Command = _attachCommand
|
||||
attachCommand.SetUsageTemplate(UsageTemplate())
|
||||
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.BoolVar(&attachCommand.NoStdin, "no-stdin", false, "Do not attach STDIN. The default is false")
|
||||
|
|
|
|||
|
|
@ -48,6 +48,7 @@ var (
|
|||
|
||||
func init() {
|
||||
buildCommand.Command = _buildCommand
|
||||
buildCommand.SetUsageTemplate(UsageTemplate())
|
||||
flags := buildCommand.Flags()
|
||||
flags.SetInterspersed(false)
|
||||
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@ var (
|
|||
|
||||
func init() {
|
||||
checkpointCommand.Command = _checkpointCommand
|
||||
checkpointCommand.SetUsageTemplate(UsageTemplate())
|
||||
|
||||
flags := checkpointCommand.Flags()
|
||||
flags.BoolVarP(&checkpointCommand.Keep, "keep", "k", false, "Keep all temporary checkpoint files")
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@ var (
|
|||
|
||||
func init() {
|
||||
cleanupCommand.Command = _cleanupCommand
|
||||
cleanupCommand.SetUsageTemplate(UsageTemplate())
|
||||
flags := cleanupCommand.Flags()
|
||||
|
||||
flags.BoolVarP(&cleanupCommand.All, "all", "a", false, "Cleans up all containers")
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ func getMainCommands() []*cobra.Command {
|
|||
_restartCommand,
|
||||
_restoreCommand,
|
||||
_rmCommand,
|
||||
_runCommmand,
|
||||
_runCommand,
|
||||
_saveCommand,
|
||||
_searchCommand,
|
||||
_signCommand,
|
||||
|
|
@ -82,7 +82,7 @@ func getContainerSubCommands() []*cobra.Command {
|
|||
_restartCommand,
|
||||
_restoreCommand,
|
||||
_rmCommand,
|
||||
_runCommmand,
|
||||
_runCommand,
|
||||
_runlabelCommand,
|
||||
_startCommand,
|
||||
_statsCommand,
|
||||
|
|
|
|||
|
|
@ -39,6 +39,7 @@ var (
|
|||
|
||||
func init() {
|
||||
commitCommand.Command = _commitCommand
|
||||
commitCommand.SetUsageTemplate(UsageTemplate())
|
||||
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.StringVarP(&commitCommand.Format, "format", "f", "oci", "`Format` of the image manifest and metadata")
|
||||
|
|
|
|||
|
|
@ -500,3 +500,27 @@ func scrubServer(server string) string {
|
|||
server = strings.TrimPrefix(server, "https://")
|
||||
return strings.TrimPrefix(server, "http://")
|
||||
}
|
||||
|
||||
// UsageTemplate returns the usage template for podman commands
|
||||
// This blocks the desplaying of the global options. The main podman
|
||||
// command should not use this.
|
||||
func UsageTemplate() string {
|
||||
return `Usage:{{if .Runnable}}
|
||||
{{.UseLine}}{{end}}{{if .HasAvailableSubCommands}}
|
||||
|
||||
{{.CommandPath}} [command]{{end}}{{if gt (len .Aliases) 0}}
|
||||
|
||||
Aliases:
|
||||
{{.NameAndAliases}}{{end}}{{if .HasExample}}
|
||||
|
||||
Examples:
|
||||
{{.Example}}{{end}}{{if .HasAvailableSubCommands}}
|
||||
|
||||
Available Commands:{{range .Commands}}{{if (or .IsAvailableCommand (eq .Name "help"))}}
|
||||
{{rpad .Name .NamePadding }} {{.Short}}{{end}}{{end}}{{end}}{{if .HasAvailableLocalFlags}}
|
||||
|
||||
Flags:
|
||||
{{.LocalFlags.FlagUsages | trimTrailingWhitespaces}}{{end}}{{if .HasAvailableInheritedFlags}}
|
||||
{{end}}
|
||||
`
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,5 +23,6 @@ var containerCommands = []*cobra.Command{
|
|||
func init() {
|
||||
containerCommand.AddCommand(containerCommands...)
|
||||
containerCommand.AddCommand(getContainerSubCommands()...)
|
||||
containerCommand.SetUsageTemplate(UsageTemplate())
|
||||
rootCmd.AddCommand(containerCommand.Command)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -34,6 +34,7 @@ var (
|
|||
|
||||
func init() {
|
||||
pruneContainersCommand.Command = _pruneContainersCommand
|
||||
pruneContainersCommand.SetUsageTemplate(UsageTemplate())
|
||||
}
|
||||
|
||||
func pruneContainers(runtime *adapter.LocalRuntime, ctx context.Context, maxWorkers int, force bool) error {
|
||||
|
|
|
|||
|
|
@ -60,6 +60,7 @@ var (
|
|||
|
||||
func init() {
|
||||
createCommand.PodmanCommand.Command = _createCommand
|
||||
createCommand.SetUsageTemplate(UsageTemplate())
|
||||
|
||||
getCreateFlags(&createCommand.PodmanCommand)
|
||||
flags := createCommand.Flags()
|
||||
|
|
|
|||
|
|
@ -52,6 +52,7 @@ var (
|
|||
|
||||
func init() {
|
||||
diffCommand.Command = _diffCommand
|
||||
diffCommand.SetUsageTemplate(UsageTemplate())
|
||||
flags := diffCommand.Flags()
|
||||
|
||||
flags.BoolVar(&diffCommand.Archive, "archive", true, "Save the diff as a tar archive")
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@ var (
|
|||
|
||||
func init() {
|
||||
execCommand.Command = _execCommand
|
||||
execCommand.SetUsageTemplate(UsageTemplate())
|
||||
flags := execCommand.Flags()
|
||||
flags.SetInterspersed(false)
|
||||
flags.StringSliceVarP(&execCommand.Env, "env", "e", []string{}, "Set environment variables")
|
||||
|
|
|
|||
|
|
@ -72,8 +72,11 @@ var (
|
|||
|
||||
func init() {
|
||||
imageExistsCommand.Command = _imageExistsCommand
|
||||
imageExistsCommand.SetUsageTemplate(UsageTemplate())
|
||||
containerExistsCommand.Command = _containerExistsCommand
|
||||
containerExistsCommand.SetUsageTemplate(UsageTemplate())
|
||||
podExistsCommand.Command = _podExistsCommand
|
||||
podExistsCommand.SetUsageTemplate(UsageTemplate())
|
||||
}
|
||||
|
||||
func imageExistsCmd(c *cliconfig.ImageExistsValues) error {
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@ var (
|
|||
|
||||
func init() {
|
||||
exportCommand.Command = _exportCommand
|
||||
exportCommand.SetUsageTemplate(UsageTemplate())
|
||||
flags := exportCommand.Flags()
|
||||
flags.StringVarP(&exportCommand.Output, "output", "o", "/dev/stdout", "Write to a file, default is STDOUT")
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,4 +17,5 @@ var generateCommand = cliconfig.PodmanCommand{
|
|||
|
||||
func init() {
|
||||
generateCommand.AddCommand(getGenerateSubCommands()...)
|
||||
generateCommand.SetUsageTemplate(UsageTemplate())
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@ var (
|
|||
|
||||
func init() {
|
||||
containerKubeCommand.Command = _containerKubeCommand
|
||||
containerKubeCommand.SetUsageTemplate(UsageTemplate())
|
||||
flags := containerKubeCommand.Flags()
|
||||
flags.BoolVarP(&containerKubeCommand.Service, "service", "s", false, "Generate YAML for kubernetes service object")
|
||||
}
|
||||
|
|
|
|||
|
|
@ -53,6 +53,7 @@ var (
|
|||
|
||||
func init() {
|
||||
historyCommand.Command = _historyCommand
|
||||
historyCommand.SetUsageTemplate(UsageTemplate())
|
||||
flags := historyCommand.Flags()
|
||||
flags.StringVar(&historyCommand.Format, "format", "", "Change the output to JSON or a Go template")
|
||||
flags.BoolVarP(&historyCommand.Human, "human", "H", true, "Display sizes and dates in human readable format")
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@ var imageSubCommands = []*cobra.Command{
|
|||
}
|
||||
|
||||
func init() {
|
||||
imageCommand.SetUsageTemplate(UsageTemplate())
|
||||
imageCommand.AddCommand(imageSubCommands...)
|
||||
imageCommand.AddCommand(getImageSubCommands()...)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -102,6 +102,7 @@ var (
|
|||
|
||||
func init() {
|
||||
imagesCommand.Command = _imagesCommand
|
||||
imagesCommand.SetUsageTemplate(UsageTemplate())
|
||||
flags := imagesCommand.Flags()
|
||||
flags.BoolVarP(&imagesCommand.All, "all", "a", false, "Show all images (default hides intermediate images)")
|
||||
flags.BoolVar(&imagesCommand.Digests, "digests", false, "Show digests")
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@ var (
|
|||
|
||||
func init() {
|
||||
pruneImagesCommand.Command = _pruneImagesCommand
|
||||
pruneImagesCommand.SetUsageTemplate(UsageTemplate())
|
||||
flags := pruneImagesCommand.Flags()
|
||||
flags.BoolVarP(&pruneImagesCommand.All, "all", "a", false, "Remove all unused images, not just dangling ones")
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@ var (
|
|||
|
||||
func init() {
|
||||
importCommand.Command = _importCommand
|
||||
importCommand.SetUsageTemplate(UsageTemplate())
|
||||
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.StringVarP(&importCommand.Message, "message", "m", "", "Set commit message for imported image")
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@ var (
|
|||
|
||||
func init() {
|
||||
infoCommand.Command = _infoCommand
|
||||
infoCommand.SetUsageTemplate(UsageTemplate())
|
||||
flags := infoCommand.Flags()
|
||||
|
||||
flags.BoolVarP(&infoCommand.Debug, "debug", "D", false, "Display additional debug information")
|
||||
|
|
|
|||
|
|
@ -40,6 +40,7 @@ var (
|
|||
|
||||
func init() {
|
||||
inspectCommand.Command = _inspectCommand
|
||||
inspectCommand.SetUsageTemplate(UsageTemplate())
|
||||
flags := inspectCommand.Flags()
|
||||
flags.StringVarP(&inspectCommand.TypeObject, "type", "t", inspectAll, "Return JSON for specified type, (e.g image, container or task)")
|
||||
flags.StringVarP(&inspectCommand.Format, "format", "f", "", "Change the output format to a Go template")
|
||||
|
|
|
|||
|
|
@ -34,6 +34,7 @@ var (
|
|||
|
||||
func init() {
|
||||
killCommand.Command = _killCommand
|
||||
killCommand.SetUsageTemplate(UsageTemplate())
|
||||
flags := killCommand.Flags()
|
||||
|
||||
flags.BoolVarP(&killCommand.All, "all", "a", false, "Signal all running containers")
|
||||
|
|
|
|||
|
|
@ -34,6 +34,7 @@ var (
|
|||
|
||||
func init() {
|
||||
loadCommand.Command = _loadCommand
|
||||
loadCommand.SetUsageTemplate(UsageTemplate())
|
||||
flags := loadCommand.Flags()
|
||||
flags.StringVarP(&loadCommand.Input, "input", "i", "/dev/stdin", "Read from archive file, default is STDIN")
|
||||
flags.BoolVarP(&loadCommand.Quiet, "quiet", "q", false, "Suppress the output")
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@ var (
|
|||
|
||||
func init() {
|
||||
loginCommand.Command = _loginCommand
|
||||
loginCommand.SetUsageTemplate(UsageTemplate())
|
||||
flags := loginCommand.Flags()
|
||||
|
||||
flags.StringVar(&loginCommand.Authfile, "authfile", "", "Path of the authentication file. Default is ${XDG_RUNTIME_DIR}/containers/auth.json. Use REGISTRY_AUTH_FILE environment variable to override")
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@ var (
|
|||
|
||||
func init() {
|
||||
logoutCommand.Command = _logoutCommand
|
||||
logoutCommand.SetUsageTemplate(UsageTemplate())
|
||||
flags := logoutCommand.Flags()
|
||||
flags.BoolVarP(&logoutCommand.All, "all", "a", false, "Remove the cached credentials for all registries in the auth file")
|
||||
flags.StringVar(&logoutCommand.Authfile, "authfile", "", "Path of the authentication file. Default is ${XDG_RUNTIME_DIR}/containers/auth.json. Use REGISTRY_AUTH_FILE environment variable to override")
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@ var (
|
|||
|
||||
func init() {
|
||||
logsCommand.Command = _logsCommand
|
||||
logsCommand.SetUsageTemplate(UsageTemplate())
|
||||
flags := logsCommand.Flags()
|
||||
flags.BoolVar(&logsCommand.Details, "details", false, "Show extra details provided to the logs")
|
||||
flags.BoolVarP(&logsCommand.Follow, "follow", "f", false, "Follow log output. The default is false")
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ var cmdsNotRequiringRootless = map[*cobra.Command]bool{
|
|||
_killCommand: true,
|
||||
_pauseCommand: true,
|
||||
_restartCommand: true,
|
||||
_runCommmand: true,
|
||||
_runCommand: true,
|
||||
_unpauseCommand: true,
|
||||
_searchCommand: true,
|
||||
_statsCommand: true,
|
||||
|
|
@ -205,7 +205,7 @@ func main() {
|
|||
exitCode = status.ExitStatus()
|
||||
}
|
||||
}
|
||||
fmt.Fprintln(os.Stderr, err.Error())
|
||||
fmt.Fprintln(os.Stderr, "Error:", err.Error())
|
||||
}
|
||||
} else {
|
||||
// The exitCode modified from 125, indicates an application
|
||||
|
|
|
|||
|
|
@ -39,6 +39,7 @@ var (
|
|||
|
||||
func init() {
|
||||
mountCommand.Command = _mountCommand
|
||||
mountCommand.SetUsageTemplate(UsageTemplate())
|
||||
flags := mountCommand.Flags()
|
||||
flags.BoolVarP(&mountCommand.All, "all", "a", false, "Mount all containers")
|
||||
flags.StringVar(&mountCommand.Format, "format", "", "Change the output format to Go template")
|
||||
|
|
|
|||
|
|
@ -34,6 +34,7 @@ var (
|
|||
|
||||
func init() {
|
||||
pauseCommand.Command = _pauseCommand
|
||||
pauseCommand.SetUsageTemplate(UsageTemplate())
|
||||
flags := pauseCommand.Flags()
|
||||
flags.BoolVarP(&pauseCommand.All, "all", "a", false, "Pause all running containers")
|
||||
|
||||
|
|
|
|||
|
|
@ -5,18 +5,18 @@ import (
|
|||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
var playCommand cliconfig.PodmanCommand
|
||||
|
||||
func init() {
|
||||
var playDescription = "Play a pod and its containers from a structured file."
|
||||
playCommand.Command = &cobra.Command{
|
||||
var (
|
||||
playCommand cliconfig.PodmanCommand
|
||||
playDescription = "Play a pod and its containers from a structured file."
|
||||
_playCommand = &cobra.Command{
|
||||
Use: "play",
|
||||
Short: "Play a pod",
|
||||
Long: playDescription,
|
||||
}
|
||||
|
||||
}
|
||||
)
|
||||
|
||||
func init() {
|
||||
playCommand.Command = _playCommand
|
||||
playCommand.SetUsageTemplate(UsageTemplate())
|
||||
playCommand.AddCommand(getPlaySubCommands()...)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -43,6 +43,7 @@ var (
|
|||
|
||||
func init() {
|
||||
playKubeCommand.Command = _playKubeCommand
|
||||
playKubeCommand.SetUsageTemplate(UsageTemplate())
|
||||
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.CertDir, "cert-dir", "", "`Pathname` of a directory containing TLS certificates and keys")
|
||||
|
|
|
|||
|
|
@ -20,4 +20,5 @@ var podCommand = cliconfig.PodmanCommand{
|
|||
|
||||
func init() {
|
||||
podCommand.AddCommand(getPodSubCommands()...)
|
||||
podCommand.SetUsageTemplate(UsageTemplate())
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@ var (
|
|||
|
||||
func init() {
|
||||
podCreateCommand.Command = _podCreateCommand
|
||||
podCreateCommand.SetUsageTemplate(UsageTemplate())
|
||||
flags := podCreateCommand.Flags()
|
||||
flags.SetInterspersed(false)
|
||||
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@ var (
|
|||
|
||||
func init() {
|
||||
podInspectCommand.Command = _podInspectCommand
|
||||
podInspectCommand.SetUsageTemplate(UsageTemplate())
|
||||
flags := podInspectCommand.Flags()
|
||||
flags.BoolVarP(&podInspectCommand.Latest, "latest", "l", false, "Act on the latest container podman is aware of")
|
||||
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@ var (
|
|||
|
||||
func init() {
|
||||
podKillCommand.Command = _podKillCommand
|
||||
podKillCommand.SetUsageTemplate(UsageTemplate())
|
||||
flags := podKillCommand.Flags()
|
||||
flags.BoolVarP(&podKillCommand.All, "all", "a", false, "Kill all containers in all pods")
|
||||
flags.BoolVarP(&podKillCommand.Latest, "latest", "l", false, "Act on the latest pod podman is aware of")
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ var (
|
|||
|
||||
func init() {
|
||||
podPauseCommand.Command = _podPauseCommand
|
||||
podPauseCommand.SetUsageTemplate(UsageTemplate())
|
||||
flags := podPauseCommand.Flags()
|
||||
flags.BoolVarP(&podPauseCommand.All, "all", "a", false, "Pause all running pods")
|
||||
flags.BoolVarP(&podPauseCommand.Latest, "latest", "l", false, "Act on the latest pod podman is aware of")
|
||||
|
|
|
|||
|
|
@ -131,6 +131,7 @@ var (
|
|||
|
||||
func init() {
|
||||
podPsCommand.Command = _podPsCommand
|
||||
podPsCommand.SetUsageTemplate(UsageTemplate())
|
||||
flags := podPsCommand.Flags()
|
||||
flags.BoolVar(&podPsCommand.CtrNames, "ctr-names", false, "Display the container names")
|
||||
flags.BoolVar(&podPsCommand.CtrIDs, "ctr-ids", false, "Display the container UUIDs. If no-trunc is not set they will be truncated")
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@ var (
|
|||
|
||||
func init() {
|
||||
podRestartCommand.Command = _podRestartCommand
|
||||
podRestartCommand.SetUsageTemplate(UsageTemplate())
|
||||
flags := podRestartCommand.Flags()
|
||||
flags.BoolVarP(&podRestartCommand.All, "all", "a", false, "Restart all running pods")
|
||||
flags.BoolVarP(&podRestartCommand.Latest, "latest", "l", false, "Restart the latest pod podman is aware of")
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@ If --force is specified, all containers will be stopped, then removed.
|
|||
|
||||
func init() {
|
||||
podRmCommand.Command = _podRmCommand
|
||||
podRmCommand.SetUsageTemplate(UsageTemplate())
|
||||
flags := podRmCommand.Flags()
|
||||
flags.BoolVarP(&podRmCommand.All, "all", "a", false, "Remove all running pods")
|
||||
flags.BoolVarP(&podRmCommand.Force, "force", "f", false, "Force removal of a running pod by first stopping all containers, then removing all containers in the pod. The default is false")
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@ var (
|
|||
|
||||
func init() {
|
||||
podStartCommand.Command = _podStartCommand
|
||||
podStartCommand.SetUsageTemplate(UsageTemplate())
|
||||
flags := podStartCommand.Flags()
|
||||
flags.BoolVarP(&podStartCommand.All, "all", "a", false, "Start all pods")
|
||||
flags.BoolVarP(&podStartCommand.Latest, "latest", "l", false, "Start the latest pod podman is aware of")
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@ var (
|
|||
|
||||
func init() {
|
||||
podStatsCommand.Command = _podStatsCommand
|
||||
podStatsCommand.SetUsageTemplate(UsageTemplate())
|
||||
flags := podStatsCommand.Flags()
|
||||
flags.BoolVarP(&podStatsCommand.All, "all", "a", false, "Provide stats for all running pods")
|
||||
flags.StringVar(&podStatsCommand.Format, "format", "", "Pretty-print container statistics to JSON or using a Go template")
|
||||
|
|
|
|||
|
|
@ -33,6 +33,7 @@ var (
|
|||
|
||||
func init() {
|
||||
podStopCommand.Command = _podStopCommand
|
||||
podStopCommand.SetUsageTemplate(UsageTemplate())
|
||||
flags := podStopCommand.Flags()
|
||||
flags.BoolVarP(&podStopCommand.All, "all", "a", false, "Stop all running pods")
|
||||
flags.BoolVarP(&podStopCommand.Latest, "latest", "l", false, "Stop the latest pod podman is aware of")
|
||||
|
|
|
|||
|
|
@ -39,6 +39,7 @@ the latest pod.
|
|||
|
||||
func init() {
|
||||
podTopCommand.Command = _podTopCommand
|
||||
podTopCommand.SetUsageTemplate(UsageTemplate())
|
||||
flags := podTopCommand.Flags()
|
||||
flags.BoolVarP(&podTopCommand.Latest, "latest,", "l", false, "Act on the latest pod podman is aware of")
|
||||
flags.BoolVar(&podTopCommand.ListDescriptors, "list-descriptors", false, "")
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@ var (
|
|||
|
||||
func init() {
|
||||
podUnpauseCommand.Command = _podUnpauseCommand
|
||||
podUnpauseCommand.SetUsageTemplate(UsageTemplate())
|
||||
flags := podUnpauseCommand.Flags()
|
||||
flags.BoolVarP(&podUnpauseCommand.All, "all", "a", false, "Unpause all running pods")
|
||||
flags.BoolVarP(&podUnpauseCommand.Latest, "latest", "l", false, "Unpause the latest pod podman is aware of")
|
||||
|
|
|
|||
|
|
@ -34,6 +34,7 @@ var (
|
|||
|
||||
func init() {
|
||||
portCommand.Command = _portCommand
|
||||
portCommand.SetUsageTemplate(UsageTemplate())
|
||||
flags := portCommand.Flags()
|
||||
|
||||
flags.BoolVarP(&portCommand.All, "all", "a", false, "Display port information for all containers")
|
||||
|
|
|
|||
|
|
@ -172,6 +172,7 @@ var (
|
|||
|
||||
func init() {
|
||||
psCommand.Command = _psCommand
|
||||
psCommand.SetUsageTemplate(UsageTemplate())
|
||||
flags := psCommand.Flags()
|
||||
flags.BoolVarP(&psCommand.All, "all", "a", false, "Show all the containers, default is only running containers")
|
||||
flags.StringSliceVarP(&psCommand.Filter, "filter", "f", []string{}, "Filter output based on conditions given")
|
||||
|
|
|
|||
|
|
@ -40,6 +40,7 @@ specified, the image with the 'latest' tag (if it exists) is pulled
|
|||
|
||||
func init() {
|
||||
pullCommand.Command = _pullCommand
|
||||
pullCommand.SetUsageTemplate(UsageTemplate())
|
||||
flags := pullCommand.Flags()
|
||||
flags.StringVar(&pullCommand.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(&pullCommand.CertDir, "cert-dir", "", "`Pathname` of a directory containing TLS certificates and keys")
|
||||
|
|
|
|||
|
|
@ -40,6 +40,7 @@ var (
|
|||
|
||||
func init() {
|
||||
pushCommand.Command = _pushCommand
|
||||
pushCommand.SetUsageTemplate(UsageTemplate())
|
||||
flags := pushCommand.Flags()
|
||||
flags.MarkHidden("signature-policy")
|
||||
flags.StringVar(&pushCommand.Authfile, "authfile", "", "Path of the authentication file. Default is ${XDG_RUNTIME_DIR}/containers/auth.json. Use REGISTRY_AUTH_FILE environment variable to override")
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ var (
|
|||
|
||||
func init() {
|
||||
refreshCommand.Command = _refreshCommand
|
||||
refreshCommand.SetUsageTemplate(UsageTemplate())
|
||||
}
|
||||
|
||||
func refreshCmd(c *cliconfig.RefreshValues) error {
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@ var (
|
|||
|
||||
func init() {
|
||||
restartCommand.Command = _restartCommand
|
||||
restartCommand.SetUsageTemplate(UsageTemplate())
|
||||
flags := restartCommand.Flags()
|
||||
flags.BoolVarP(&restartCommand.All, "all", "a", false, "Restart all non-running containers")
|
||||
flags.BoolVarP(&restartCommand.Latest, "latest", "l", false, "Act on the latest container podman is aware of")
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@ var (
|
|||
|
||||
func init() {
|
||||
restoreCommand.Command = _restoreCommand
|
||||
restoreCommand.SetUsageTemplate(UsageTemplate())
|
||||
flags := restoreCommand.Flags()
|
||||
flags.BoolVarP(&restoreCommand.All, "all", "a", false, "Restore all checkpointed containers")
|
||||
flags.BoolVarP(&restoreCommand.Keep, "keep", "k", false, "Keep all temporary checkpoint files")
|
||||
|
|
|
|||
|
|
@ -34,6 +34,7 @@ Running containers will not be removed without the -f option.
|
|||
|
||||
func init() {
|
||||
rmCommand.Command = _rmCommand
|
||||
rmCommand.SetUsageTemplate(UsageTemplate())
|
||||
flags := rmCommand.Flags()
|
||||
flags.BoolVarP(&rmCommand.All, "all", "a", false, "Remove all containers")
|
||||
flags.BoolVarP(&rmCommand.Force, "force", "f", false, "Force removal of a running container. The default is false")
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@ var (
|
|||
|
||||
func init() {
|
||||
rmiCommand.Command = _rmiCommand
|
||||
rmiCommand.SetUsageTemplate(UsageTemplate())
|
||||
flags := rmiCommand.Flags()
|
||||
flags.BoolVarP(&rmiCommand.All, "all", "a", false, "Remove all images")
|
||||
flags.BoolVarP(&rmiCommand.Force, "force", "f", false, "Force Removal of the image")
|
||||
|
|
|
|||
|
|
@ -18,28 +18,29 @@ import (
|
|||
)
|
||||
|
||||
var (
|
||||
runCommmand cliconfig.RunValues
|
||||
runCommand cliconfig.RunValues
|
||||
|
||||
runDescription = "Runs a command in a new container from the given image"
|
||||
_runCommmand = &cobra.Command{
|
||||
_runCommand = &cobra.Command{
|
||||
Use: "run",
|
||||
Short: "Run a command in a new container",
|
||||
Long: runDescription,
|
||||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
runCommmand.InputArgs = args
|
||||
runCommmand.GlobalFlags = MainGlobalOpts
|
||||
return runCmd(&runCommmand)
|
||||
runCommand.InputArgs = args
|
||||
runCommand.GlobalFlags = MainGlobalOpts
|
||||
return runCmd(&runCommand)
|
||||
},
|
||||
Example: "IMAGE [COMMAND [ARG...]]",
|
||||
}
|
||||
)
|
||||
|
||||
func init() {
|
||||
runCommmand.Command = _runCommmand
|
||||
flags := runCommmand.Flags()
|
||||
runCommand.Command = _runCommand
|
||||
runCommand.SetUsageTemplate(UsageTemplate())
|
||||
flags := runCommand.Flags()
|
||||
flags.SetInterspersed(false)
|
||||
flags.Bool("sig-proxy", true, "Proxy received signals to the process (default true)")
|
||||
getCreateFlags(&runCommmand.PodmanCommand)
|
||||
getCreateFlags(&runCommand.PodmanCommand)
|
||||
}
|
||||
|
||||
func runCmd(c *cliconfig.RunValues) error {
|
||||
|
|
|
|||
|
|
@ -37,6 +37,7 @@ Executes a command as described by a container image label.
|
|||
|
||||
func init() {
|
||||
runlabelCommand.Command = _runlabelCommand
|
||||
runlabelCommand.SetUsageTemplate(UsageTemplate())
|
||||
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.CertDir, "cert-dir", "", "`Pathname` of a directory containing TLS certificates and keys")
|
||||
|
|
|
|||
|
|
@ -47,6 +47,7 @@ var (
|
|||
|
||||
func init() {
|
||||
saveCommand.Command = _saveCommand
|
||||
saveCommand.SetUsageTemplate(UsageTemplate())
|
||||
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.StringVar(&saveCommand.Format, "format", "", "Save image to oci-archive, oci-dir (directory with oci manifest type), docker-dir (directory with v2s2 manifest type)")
|
||||
|
|
|
|||
|
|
@ -43,6 +43,7 @@ var (
|
|||
|
||||
func init() {
|
||||
searchCommand.Command = _searchCommand
|
||||
searchCommand.SetUsageTemplate(UsageTemplate())
|
||||
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.StringSliceVarP(&searchCommand.Filter, "filter", "f", []string{}, "Filter output based on conditions provided (default [])")
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@ var (
|
|||
|
||||
func init() {
|
||||
signCommand.Command = _signCommand
|
||||
signCommand.SetUsageTemplate(UsageTemplate())
|
||||
flags := signCommand.Flags()
|
||||
flags.StringVarP(&signCommand.Directory, "directory", "d", "", "Define an alternate directory to store signatures")
|
||||
flags.StringVar(&signCommand.SignBy, "sign-by", "", "Name of the signing key")
|
||||
|
|
|
|||
|
|
@ -36,6 +36,7 @@ var (
|
|||
|
||||
func init() {
|
||||
startCommand.Command = _startCommand
|
||||
startCommand.SetUsageTemplate(UsageTemplate())
|
||||
flags := startCommand.Flags()
|
||||
flags.BoolVarP(&startCommand.Attach, "attach", "a", false, "Attach container's STDOUT and STDERR")
|
||||
flags.StringVar(&startCommand.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 _")
|
||||
|
|
|
|||
|
|
@ -47,6 +47,7 @@ var (
|
|||
|
||||
func init() {
|
||||
statsCommand.Command = _statsCommand
|
||||
statsCommand.SetUsageTemplate(UsageTemplate())
|
||||
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.StringVar(&statsCommand.Format, "format", "", "Pretty-print container statistics to JSON or using a Go template")
|
||||
|
|
|
|||
|
|
@ -37,6 +37,7 @@ var (
|
|||
|
||||
func init() {
|
||||
stopCommand.Command = _stopCommand
|
||||
stopCommand.SetUsageTemplate(UsageTemplate())
|
||||
flags := stopCommand.Flags()
|
||||
flags.BoolVarP(&stopCommand.All, "all", "a", false, "Stop all running containers")
|
||||
flags.BoolVarP(&stopCommand.Latest, "latest", "l", false, "Act on the latest container podman is aware of")
|
||||
|
|
|
|||
|
|
@ -24,4 +24,5 @@ var systemCommands = []*cobra.Command{
|
|||
func init() {
|
||||
systemCommand.AddCommand(systemCommands...)
|
||||
systemCommand.AddCommand(getSystemSubCommands()...)
|
||||
systemCommand.SetUsageTemplate(UsageTemplate())
|
||||
}
|
||||
|
|
|
|||
|
|
@ -34,8 +34,8 @@ var (
|
|||
)
|
||||
|
||||
func init() {
|
||||
|
||||
pruneSystemCommand.Command = _pruneSystemCommand
|
||||
pruneSystemCommand.SetUsageTemplate(UsageTemplate())
|
||||
flags := pruneSystemCommand.Flags()
|
||||
flags.BoolVarP(&pruneSystemCommand.All, "all", "a", false, "Remove all unused data")
|
||||
flags.BoolVarP(&pruneSystemCommand.Force, "force", "f", false, "Do not prompt for confirmation")
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@ var (
|
|||
|
||||
func init() {
|
||||
tagCommand.Command = _tagCommand
|
||||
tagCommand.SetUsageTemplate(UsageTemplate())
|
||||
}
|
||||
|
||||
func tagCmd(c *cliconfig.TagValues) error {
|
||||
|
|
|
|||
|
|
@ -48,6 +48,7 @@ the latest container.
|
|||
|
||||
func init() {
|
||||
topCommand.Command = _topCommand
|
||||
topCommand.SetUsageTemplate(UsageTemplate())
|
||||
flags := topCommand.Flags()
|
||||
flags.BoolVar(&topCommand.ListDescriptors, "list-descriptors", false, "")
|
||||
flags.MarkHidden("list-descriptors")
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ var (
|
|||
)
|
||||
|
||||
func init() {
|
||||
trustCommand.SetUsageTemplate(UsageTemplate())
|
||||
trustCommand.AddCommand(getTrustSubCommands()...)
|
||||
imageCommand.AddCommand(trustCommand.Command)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -49,9 +49,10 @@ var (
|
|||
)
|
||||
|
||||
func init() {
|
||||
|
||||
setTrustCommand.Command = _setTrustCommand
|
||||
setTrustCommand.SetUsageTemplate(UsageTemplate())
|
||||
showTrustCommand.Command = _showTrustCommand
|
||||
showTrustCommand.SetUsageTemplate(UsageTemplate())
|
||||
setFlags := setTrustCommand.Flags()
|
||||
setFlags.StringVar(&setTrustCommand.PolicyPath, "policypath", "", "")
|
||||
setFlags.MarkHidden("policypath")
|
||||
|
|
|
|||
|
|
@ -37,6 +37,7 @@ An unmount can be forced with the --force flag.
|
|||
|
||||
func init() {
|
||||
umountCommand.Command = _umountCommand
|
||||
umountCommand.SetUsageTemplate(UsageTemplate())
|
||||
flags := umountCommand.Flags()
|
||||
flags.BoolVarP(&umountCommand.All, "all", "a", false, "Umount all of the currently mounted containers")
|
||||
flags.BoolVarP(&umountCommand.Force, "force", "f", false, "Force the complete umount all of the currently mounted containers")
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@ var (
|
|||
|
||||
func init() {
|
||||
unpauseCommand.Command = _unpauseCommand
|
||||
unpauseCommand.SetUsageTemplate(UsageTemplate())
|
||||
flags := unpauseCommand.Flags()
|
||||
flags.BoolVarP(&unpauseCommand.All, "all", "a", false, "Unpause all paused containers")
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@ var (
|
|||
|
||||
func init() {
|
||||
varlinkCommand.Command = _varlinkCommand
|
||||
varlinkCommand.SetUsageTemplate(UsageTemplate())
|
||||
flags := varlinkCommand.Flags()
|
||||
flags.Int64VarP(&varlinkCommand.Timeout, "timeout", "t", 1000, "Time until the varlink session expires in milliseconds. Use 0 to disable the timeout")
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@ var (
|
|||
|
||||
func init() {
|
||||
versionCommand.Command = _versionCommand
|
||||
versionCommand.SetUsageTemplate(UsageTemplate())
|
||||
flags := versionCommand.Flags()
|
||||
flags.StringVarP(&versionCommand.Format, "format", "f", "", "Change the output format to JSON or a Go template")
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,4 +19,5 @@ var volumeCommand = cliconfig.PodmanCommand{
|
|||
|
||||
func init() {
|
||||
volumeCommand.AddCommand(getVolumeSubCommands()...)
|
||||
volumeCommand.SetUsageTemplate(UsageTemplate())
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@ be created at.`
|
|||
|
||||
func init() {
|
||||
volumeCreateCommand.Command = _volumeCreateCommand
|
||||
volumeCreateCommand.SetUsageTemplate(UsageTemplate())
|
||||
flags := volumeCreateCommand.Flags()
|
||||
flags.StringVar(&volumeCreateCommand.Driver, "driver", "", "Specify volume driver name (default local)")
|
||||
flags.StringSliceVarP(&volumeCreateCommand.Label, "label", "l", []string{}, "Set metadata for a volume (default [])")
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@ from JSON to a Go template.
|
|||
|
||||
func init() {
|
||||
volumeInspectCommand.Command = _volumeInspectCommand
|
||||
volumeInspectCommand.SetUsageTemplate(UsageTemplate())
|
||||
flags := volumeInspectCommand.Flags()
|
||||
flags.BoolVarP(&volumeInspectCommand.All, "all", "a", false, "Inspect all volumes")
|
||||
flags.StringVarP(&volumeInspectCommand.Format, "format", "f", "json", "Format volume output using Go template")
|
||||
|
|
|
|||
|
|
@ -62,6 +62,7 @@ and the output format can be changed to JSON or a user specified Go template.
|
|||
|
||||
func init() {
|
||||
volumeLsCommand.Command = _volumeLsCommand
|
||||
volumeLsCommand.SetUsageTemplate(UsageTemplate())
|
||||
flags := volumeLsCommand.Flags()
|
||||
|
||||
flags.StringVarP(&volumeLsCommand.Filter, "filter", "f", "", "Filter volume output")
|
||||
|
|
|
|||
|
|
@ -37,6 +37,7 @@ using force.
|
|||
|
||||
func init() {
|
||||
volumePruneCommand.Command = _volumePruneCommand
|
||||
volumePruneCommand.SetUsageTemplate(UsageTemplate())
|
||||
flags := volumePruneCommand.Flags()
|
||||
|
||||
flags.BoolVarP(&volumePruneCommand.Force, "force", "f", false, "Do not prompt for confirmation")
|
||||
|
|
|
|||
|
|
@ -34,6 +34,7 @@ not being used by any containers. To remove the volumes anyways, use the
|
|||
|
||||
func init() {
|
||||
volumeRmCommand.Command = _volumeRmCommand
|
||||
volumeRmCommand.SetUsageTemplate(UsageTemplate())
|
||||
flags := volumeRmCommand.Flags()
|
||||
flags.BoolVarP(&volumeRmCommand.All, "all", "a", false, "Remove all volumes")
|
||||
flags.BoolVarP(&volumeRmCommand.Force, "force", "f", false, "Remove a volume by force, even if it is being used by a container")
|
||||
|
|
|
|||
|
|
@ -34,6 +34,7 @@ var (
|
|||
|
||||
func init() {
|
||||
waitCommand.Command = _waitCommand
|
||||
waitCommand.SetUsageTemplate(UsageTemplate())
|
||||
flags := waitCommand.Flags()
|
||||
flags.UintVarP(&waitCommand.Interval, "interval", "i", 250, "Milliseconds to wait before polling for completion")
|
||||
flags.BoolVarP(&waitCommand.Latest, "latest", "l", false, "Act on the latest container podman is aware of")
|
||||
|
|
|
|||
Loading…
Reference in New Issue