summaryrefslogtreecommitdiff
path: root/makeAutocompleteFiles.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-10-12 03:33:53 -0500
committerJeff Carr <[email protected]>2025-10-12 03:33:53 -0500
commit3db85febbf02380bc5c38abd660668f1ef53a9c8 (patch)
tree3f4c498847f71f2ed423cec47aa11c520d95d270 /makeAutocompleteFiles.go
parent36f7422d2fc62e5d84726633b2bb9ca07b75b555 (diff)
finally a standard place for time.Time() formatting
Diffstat (limited to 'makeAutocompleteFiles.go')
-rw-r--r--makeAutocompleteFiles.go16
1 files changed, 16 insertions, 0 deletions
diff --git a/makeAutocompleteFiles.go b/makeAutocompleteFiles.go
index 647abe3..57bf391 100644
--- a/makeAutocompleteFiles.go
+++ b/makeAutocompleteFiles.go
@@ -12,6 +12,22 @@ import (
"go.wit.com/log"
)
+func detectShell() string {
+ // Zsh sets ZSH_VERSION. We use os.LookupEnv which returns a boolean
+ // indicating if the variable is present.
+ if _, ok := os.LookupEnv("ZSH_VERSION"); ok {
+ return "zsh"
+ }
+
+ // Bash sets BASH_VERSION.
+ if _, ok := os.LookupEnv("BASH_VERSION"); ok {
+ return "bash"
+ }
+
+ // Fallback if neither is found.
+ return "unknown"
+}
+
// makes a autocomplete file for your command
func makeAutocompleteFiles(argname string) {
fmt.Println(makeBashCompletionText2(argname))