From 1a24269223af7b3ef0ca9b0cbfc46600ce156992 Mon Sep 17 00:00:00 2001 From: Ahmet Alp Balkan Date: Fri, 27 Mar 2015 14:11:37 -0700 Subject: [PATCH] Print only base binary name in usage string (win) When `boot2docker` is called from msys bash shell, usage string prints the full path of the binary (e.g. `c:\program file\boot2docker for windows\boot2docker.exe`) in the short usage string. This change fixes that without breaking the behavior on unix systems or cmd.exe/powershell on windows which already print the short binary name Signed-off-by: Ahmet Alp Balkan --- config.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/config.go b/config.go index fc82d40..d29b324 100644 --- a/config.go +++ b/config.go @@ -178,7 +178,8 @@ func config() (*flag.FlagSet, error) { } func usageShort() { - fmt.Fprintf(os.Stderr, "Usage: %s [] {help|init|up|ssh|save|down|poweroff|reset|restart|config|status|info|ip|shellinit|delete|download|upgrade|version} []\n", os.Args[0]) + binName := filepath.Base(os.Args[0]) + fmt.Fprintf(os.Stderr, "Usage: %s [] {help|init|up|ssh|save|down|poweroff|reset|restart|config|status|info|ip|shellinit|delete|download|upgrade|version} []\n", binName) } func usageLong(flags *flag.FlagSet) {