Skip to content
This repository was archived by the owner on Feb 27, 2018. It is now read-only.

Commit 1a24269

Browse files
committed
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 <ahmetalpbalkan@gmail.com>
1 parent ad28233 commit 1a24269

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

config.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,8 @@ func config() (*flag.FlagSet, error) {
178178
}
179179

180180
func usageShort() {
181-
fmt.Fprintf(os.Stderr, "Usage: %s [<options>] {help|init|up|ssh|save|down|poweroff|reset|restart|config|status|info|ip|shellinit|delete|download|upgrade|version} [<args>]\n", os.Args[0])
181+
binName := filepath.Base(os.Args[0])
182+
fmt.Fprintf(os.Stderr, "Usage: %s [<options>] {help|init|up|ssh|save|down|poweroff|reset|restart|config|status|info|ip|shellinit|delete|download|upgrade|version} [<args>]\n", binName)
182183
}
183184

184185
func usageLong(flags *flag.FlagSet) {

0 commit comments

Comments
 (0)