Add a 'start' command

When any non-global-flag parameter appears on the command line make sure
there's a "command" even in the 'start' (run) case to ensure its not
ambiguous as to what the arg is. For example, w/o this fix its not
clear if
   runc foo
means 'foo' is the name of a config file or an unknown command.  Or worse,
you can't name a config file the same a ANY command, even future (yet to
be created) commands.

We should fix this now before we ship 1.0 and are forced to support this
ambiguous case for a long time.

Signed-off-by: Doug Davis <dug@us.ibm.com>
This commit is contained in:
Doug Davis
2015-08-17 18:30:17 -07:00
parent 744a6b0e7b
commit 714ae2acc9
3 changed files with 52 additions and 31 deletions
+8 -2
View File
@@ -24,7 +24,11 @@ After creating a spec for your root filesystem with runc, you can execute a
container in your shell by running:
cd /mycontainer
runc [ spec-file ]
runc start
or
cd /mycontainer
runc start [ spec-file ]
If not specified, the default value for the 'spec-file' is 'config.json'. `
)
@@ -56,6 +60,7 @@ func main() {
},
}
app.Commands = []cli.Command{
startCommand,
checkpointCommand,
eventsCommand,
restoreCommand,
@@ -69,7 +74,8 @@ func main() {
return nil
}
app.Action = runAction
// Default to 'start' is no command is specified
app.Action = startCommand.Action
if err := app.Run(os.Args); err != nil {
logrus.Fatal(err)