Files
podman/cmd/podman/volume.go
Daniel J Walsh 181f327d57 More cleanup for failures on missing commands.
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>
2019-03-08 07:06:50 -05:00

31 lines
676 B
Go

package main
import (
"github.com/containers/libpod/cmd/podman/cliconfig"
"github.com/spf13/cobra"
)
var volumeDescription = `Volumes are created in and can be shared between containers.`
var volumeCommand = cliconfig.PodmanCommand{
Command: &cobra.Command{
Use: "volume",
Short: "Manage volumes",
Long: volumeDescription,
RunE: commandRunE(),
},
}
var volumeSubcommands = []*cobra.Command{
_volumeCreateCommand,
_volumeLsCommand,
_volumeRmCommand,
_volumeInspectCommand,
_volumePruneCommand,
}
func init() {
volumeCommand.SetUsageTemplate(UsageTemplate())
volumeCommand.AddCommand(volumeSubcommands...)
rootCmd.AddCommand(volumeCommand.Command)
}