From 3db85febbf02380bc5c38abd660668f1ef53a9c8 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Sun, 12 Oct 2025 03:33:53 -0500 Subject: finally a standard place for time.Time() formatting --- makeAutocompleteFiles.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'makeAutocompleteFiles.go') 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)) -- cgit v1.2.3