Merge pull request #668 from ehazlett/support-fish-in-env

show fish usage upon create
This commit is contained in:
Evan Hazlett 2015-03-02 12:20:22 -05:00
commit dca385690d
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)
}
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) {