From bb1c52ac8893e6fdcd11f13bd21d8ce1c1b3de60 Mon Sep 17 00:00:00 2001 From: Fabian Ruff Date: Thu, 19 Feb 2015 13:21:54 +0100 Subject: [PATCH] support for fish shell in env command Signed-off-by: Fabian Ruff --- commands.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/commands.go b/commands.go index 65f5662488..0d89704038 100644 --- a/commands.go +++ b/commands.go @@ -398,8 +398,14 @@ func cmdEnv(c *cli.Context) { if err != nil { log.Fatal(err) } - fmt.Printf("export DOCKER_TLS_VERIFY=yes\nexport DOCKER_CERT_PATH=%s\nexport DOCKER_HOST=%s\n", - utils.GetMachineClientCertDir(), cfg.machineUrl) + switch filepath.Base(os.Getenv("SHELL")) { + case "fish": + fmt.Printf("set -x DOCKER_TLS_VERIFY yes\nset -x DOCKER_CERT_PATH %s\nset -x DOCKER_HOST %s\n", + utils.GetMachineClientCertDir(), cfg.machineUrl) + default: + fmt.Printf("export DOCKER_TLS_VERIFY=yes\nexport DOCKER_CERT_PATH=%s\nexport DOCKER_HOST=%s\n", + utils.GetMachineClientCertDir(), cfg.machineUrl) + } } func cmdSsh(c *cli.Context) {