diff options
| author | Jeff Carr <[email protected]> | 2025-10-13 13:30:57 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-10-13 13:30:57 -0500 |
| commit | 1394e7b03eed71f3c637b78627e78aa48a3ec092 (patch) | |
| tree | 5f90719c03b0a1a78491d30f789acdfbb51b5b22 | |
| parent | 35ac3f03598447b436dae82fb779c1bf412f9188 (diff) | |
shell detection
| -rw-r--r-- | makeAutocompleteFiles.go | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/makeAutocompleteFiles.go b/makeAutocompleteFiles.go index 2010c42..2a5f972 100644 --- a/makeAutocompleteFiles.go +++ b/makeAutocompleteFiles.go @@ -7,9 +7,23 @@ import ( func MakeAutocompleteFiles(argname string) { if _, ok := os.LookupEnv("BASH_VERSION"); ok { MakeBashCompleteFiles(argname) + return } if _, ok := os.LookupEnv("ZSH_VERSION"); ok { MakeZshCompleteFiles(argname) + return + } + + if s, ok := os.LookupEnv("SHELL"); ok { + switch s { + case "/bin/bash": + MakeBashCompleteFiles(argname) + return + case "/bin/zsh": + MakeZshCompleteFiles(argname) + return + } + MakeBashCompleteFiles(argname) } } |
