mirror of
https://github.com/containers/podman.git
synced 2025-12-15 03:18:45 +08:00
Currently in podman if a user specifies a command that does not exist the tool shows the help information. This patch changes it to show information like: $ ./bin/podman foobar Error: unrecognized command 'podman foobar' Try 'podman --help' for more information. $ ./bin/podman volume foobar Error: unrecognized command `podman volume foobar` Try 'podman volume --help' for more information. $ ./bin/podman container foobar Error: unrecognized command `podman container foobar` Try 'podman container --help' for more information. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
27 lines
688 B
Go
27 lines
688 B
Go
package main
|
|
|
|
import (
|
|
"github.com/containers/libpod/cmd/podman/cliconfig"
|
|
"github.com/spf13/cobra"
|
|
)
|
|
|
|
var healthcheckDescription = "Manage health checks on containers"
|
|
var healthcheckCommand = cliconfig.PodmanCommand{
|
|
Command: &cobra.Command{
|
|
Use: "healthcheck",
|
|
Short: "Manage Healthcheck",
|
|
Long: healthcheckDescription,
|
|
RunE: commandRunE(),
|
|
},
|
|
}
|
|
|
|
// Commands that are universally implemented
|
|
var healthcheckCommands []*cobra.Command
|
|
|
|
func init() {
|
|
healthcheckCommand.AddCommand(healthcheckCommands...)
|
|
healthcheckCommand.AddCommand(getHealtcheckSubCommands()...)
|
|
healthcheckCommand.SetUsageTemplate(UsageTemplate())
|
|
rootCmd.AddCommand(healthcheckCommand.Command)
|
|
}
|