mirror of
https://github.com/containers/podman.git
synced 2025-12-08 06:39:05 +08:00
Command-line input validation: reject unused args
Several podman commands accept no subcommands. Some of those were not actually checking, though, which could lead to user confusion. Added validation where missing; and, refactored to minimize duplication. (Side note: I decided against using cobra.NoArgs because its error message, "unknown command", misleadingly implies that there are known ones). Also added validation to varlink Signed-off-by: Ed Santiago <santiago@redhat.com>
This commit is contained in:
@@ -17,6 +17,7 @@ var (
|
||||
versionCommand cliconfig.VersionValues
|
||||
_versionCommand = &cobra.Command{
|
||||
Use: "version",
|
||||
Args: noSubArgs,
|
||||
Short: "Display the Podman Version Information",
|
||||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
versionCommand.InputArgs = args
|
||||
|
||||
Reference in New Issue
Block a user