m/fzf
1
0
mirror of https://github.com/junegunn/fzf.git synced 2025-11-13 13:53:47 -05:00

Do not validate other options when --version is present

Close #2690
This commit is contained in:
Junegunn Choi
2022-07-21 22:36:24 +09:00
parent 7a7cfcacbe
commit 3af5b7f2ac

View File

@@ -1746,6 +1746,13 @@ func postProcessOptions(opts *Options) {
func ParseOptions() *Options {
opts := defaultOptions()
for _, arg := range os.Args[1:] {
if arg == "--version" {
opts.Version = true
return opts
}
}
// Options from Env var
words, _ := shellwords.Parse(os.Getenv("FZF_DEFAULT_OPTS"))
if len(words) > 0 {