1
0
mirror of https://github.com/docker/cli.git synced 2026-01-15 07:40:57 +03:00

Make use of %USERPROFILE% in cli help message

An earlier commit was causing docker windows CLI build to not to pick up
the shorthand form for home directory (`%USERPROFILE%`) shown in when
`docker --help` is executed.

Fixing that bug and making the if statement concise and clear.

Signed-off-by: Ahmet Alp Balkan <ahmetalpbalkan@gmail.com>
Upstream-commit: 802c90500073ad79e5a6520402ef2a7268c824b7
Component: engine
This commit is contained in:
Ahmet Alp Balkan
2015-03-11 02:14:49 -07:00
parent e5672966b5
commit b147bc8ddc

View File

@@ -506,15 +506,11 @@ func Set(name, value string) error {
// otherwise, the default values of all defined flags in the set.
func (f *FlagSet) PrintDefaults() {
writer := tabwriter.NewWriter(f.Out(), 20, 1, 3, ' ', 0)
var home string
if runtime.GOOS != "windows" {
// Only do this on non-windows systems
home = homedir.Get()
home := homedir.Get()
// Don't substitute when HOME is /
if home == "/" {
home = ""
}
// Don't substitute when HOME is /
if runtime.GOOS != "windows" && home == "/" {
home = ""
}
f.VisitAll(func(flag *Flag) {
format := " -%s=%s"