mirror of
https://github.com/opencontainers/runc.git
synced 2026-07-10 21:53:57 +08:00
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:
@@ -18,11 +18,10 @@ are starting. The name you provide for the container instance must be unique on
|
||||
your host.`,
|
||||
Description: `The start command executes the user defined process in a created container .`,
|
||||
Action: func(context *cli.Context) error {
|
||||
hasError := false
|
||||
if !context.Args().Present() {
|
||||
return fmt.Errorf("runc: \"start\" requires a minimum of 1 argument")
|
||||
if err := checkArgs(context, 1, minArgs); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
hasError := false
|
||||
factory, err := loadFactory(context)
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user