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