mirror of https://github.com/docker/docs.git
show fish usage upon create
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
This commit is contained in:
parent
9acef467ff
commit
1bf70a15f0
15
commands.go
15
commands.go
|
@ -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) {
|
||||||
|
|
Loading…
Reference in New Issue