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
No known key found for this signature in database
GPG Key ID: 254BC280FEF9C627
1 changed files with 7 additions and 0 deletions

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 {