mirror of
https://github.com/vmware-tanzu/velero.git
synced 2026-08-15 11:46:06 +00:00
use cobra's arg-count validation & call Complete() before Validate()
Signed-off-by: Steve Kriss <steve@heptio.com>
This commit is contained in:
@@ -60,11 +60,8 @@ func NewCommand() *cobra.Command {
|
||||
Use: "run-plugin [KIND] [NAME]",
|
||||
Hidden: true,
|
||||
Short: "INTERNAL COMMAND ONLY - not intended to be run directly by users",
|
||||
Args: cobra.ExactArgs(2),
|
||||
Run: func(c *cobra.Command, args []string) {
|
||||
if len(args) != 2 {
|
||||
logger.Fatal("You must specify exactly two arguments, the plugin kind and the plugin name")
|
||||
}
|
||||
|
||||
kind := args[0]
|
||||
name := args[1]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user