From 1bf70a15f07c94e9f9d3627e5a7f2f24012ff060 Mon Sep 17 00:00:00 2001 From: Evan Hazlett Date: Fri, 27 Feb 2015 19:15:02 -0500 Subject: [PATCH] show fish usage upon create Signed-off-by: Evan Hazlett --- commands.go | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/commands.go b/commands.go index 92c0875134..72152f3d0e 100644 --- a/commands.go +++ b/commands.go @@ -325,8 +325,21 @@ func cmdCreate(c *cli.Context) { log.Fatalf("error setting active host: %v", err) } + info := "" + userShell := filepath.Base(os.Getenv("SHELL")) + + switch userShell { + case "fish": + info = fmt.Sprintf("%s env %s | source", c.App.Name, name) + default: + info = fmt.Sprintf("$(%s env %s)", c.App.Name, name) + } + log.Infof("%q has been created and is now the active machine.", name) - log.Infof("To point your Docker client at it, run this in your shell: $(%s env %s)", c.App.Name, name) + + if info != "" { + log.Infof("To point your Docker client at it, run this in your shell: %s", info) + } } func cmdConfig(c *cli.Context) {