From aa461f079d4a485573d1d8423d7ded76956e8534 Mon Sep 17 00:00:00 2001 From: Daehyeok Mun Date: Fri, 26 Feb 2016 10:44:54 -0700 Subject: [PATCH] DRIVER environment variable Signed-off-by: Daehyeok Mun --- commands/create.go | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/commands/create.go b/commands/create.go index 812dbeab08..56e8f066e6 100644 --- a/commands/create.go +++ b/commands/create.go @@ -40,7 +40,8 @@ var ( Usage: fmt.Sprintf( "Driver to create machine with.", ), - Value: "none", + Value: "none", + EnvVar: "MACHINE_DRIVER", }, cli.StringFlag{ Name: "engine-install-url", @@ -290,8 +291,12 @@ func cmdCreateOuter(c CommandLine, api libmachine.API) error { // We didn't recognize the driver name. driverName := flagHackLookup("--driver") if driverName == "" { - c.ShowHelp() - return nil // ? + //TODO: Check Environment have to include flagHackLookup function. + driverName = os.Getenv("MACHINE_DRIVER") + if driverName == "" { + c.ShowHelp() + return nil // ? + } } // TODO: Fix hacky JSON solution