From 7719dca0ae79279e4ee1596d2b19fdf650e34273 Mon Sep 17 00:00:00 2001 From: Zhang Wei Date: Tue, 10 Jan 2017 22:52:05 +0800 Subject: [PATCH] Fix regression of exec command Set minimal required args to 1 for `exec` command to roll back to previous behavior, also modify help message a little bit. Signed-off-by: Zhang Wei --- exec.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/exec.go b/exec.go index 544d3de4c..d25123016 100644 --- a/exec.go +++ b/exec.go @@ -18,10 +18,11 @@ import ( var execCommand = cli.Command{ Name: "exec", Usage: "execute new process inside the container", - ArgsUsage: ` [command options] + ArgsUsage: ` [command options] || -p process.json Where "" is the name for the instance of the container and -"" is the command to be executed in the container. +"" is the command to be executed in the container. +"" can't be empty unless a "-p" flag provided. EXAMPLE: For example, if the container is configured to run the linux ps command the @@ -86,7 +87,7 @@ following will output a list of processes running in the container: }, }, Action: func(context *cli.Context) error { - if err := checkArgs(context, 2, minArgs); err != nil { + if err := checkArgs(context, 1, minArgs); err != nil { return err } if os.Geteuid() != 0 {