ctr: fix args

Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
This commit is contained in:
Akihiro Suda 2017-11-14 03:01:48 +00:00
parent 17093c2f6a
commit 5eff92d1ba

View File

@ -156,7 +156,7 @@ var prepareCommand = cli.Command{
}, },
}, },
Action: func(context *cli.Context) error { Action: func(context *cli.Context) error {
if context.NArg() != 2 { if narg := context.NArg(); narg < 1 || narg > 2 {
return cli.ShowSubcommandHelp(context) return cli.ShowSubcommandHelp(context)
} }
var ( var (
@ -195,7 +195,7 @@ var viewCommand = cli.Command{
}, },
}, },
Action: func(context *cli.Context) error { Action: func(context *cli.Context) error {
if context.NArg() != 2 { if narg := context.NArg(); narg < 1 || narg > 2 {
return cli.ShowSubcommandHelp(context) return cli.ShowSubcommandHelp(context)
} }
var ( var (