Skip to content

Commit

Permalink
Remove flag_windows and use runtime
Browse files Browse the repository at this point in the history
  • Loading branch information
dearchap committed Oct 19, 2022
1 parent 374bbfb commit 96bff3c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 15 deletions.
10 changes: 9 additions & 1 deletion flag.go
Expand Up @@ -5,7 +5,9 @@ import (
"flag"
"fmt"
"io/ioutil"
"os"
"regexp"
"runtime"
"strings"
"syscall"
"time"
Expand Down Expand Up @@ -279,7 +281,13 @@ func defaultEnvFormat(envVars []string) string {
}

func withEnvHint(envVars []string, str string) string {
return str + defaultEnvFormat(envVars)
envText := ""
if runtime.GOOS != "windows" || os.Getenv("PSHOME") != "" {
envText = defaultEnvFormat(envVars)
} else {
envText = envFormat(envVars, "%", "%, %", "%")
}
return str + envText
}

func FlagNames(name string, aliases []string) []string {
Expand Down
14 changes: 0 additions & 14 deletions flag_windows.go

This file was deleted.

0 comments on commit 96bff3c

Please sign in to comment.