show fish usage upon create

Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
This commit is contained in:
Evan Hazlett 2015-02-27 19:15:02 -05:00
parent 9acef467ff
commit 1bf70a15f0
No known key found for this signature in database
GPG Key ID: A519480096146526
1 changed files with 14 additions and 1 deletions

View File

@ -325,8 +325,21 @@ func cmdCreate(c *cli.Context) {
log.Fatalf("error setting active host: %v", err) 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("%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) { func cmdConfig(c *cli.Context) {