Check args numbers before application start

Add a general args number validator for all client commands.

Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
This commit is contained in:
Zhang Wei
2016-10-28 23:43:10 +08:00
parent f156f73c2a
commit b517076907
16 changed files with 74 additions and 20 deletions
+3
View File
@@ -34,6 +34,9 @@ checkpointed.`,
cli.StringSliceFlag{Name: "empty-ns", Usage: "create a namespace, but don't restore its properies"},
},
Action: func(context *cli.Context) error {
if err := checkArgs(context, 1, exactArgs); err != nil {
return err
}
container, err := getContainer(context)
if err != nil {
return err