Source File
env.go
Belonging Package
github.com/carapace-sh/carapace/internal/env
package envimport ()const (CARAPACE_COMPLINE = "CARAPACE_COMPLINE" // TODOCARAPACE_COVERDIR = "CARAPACE_COVERDIR" // coverage directory for sandbox testsCARAPACE_EXPERIMENTAL = "CARAPACE_EXPERIMENTAL" // enable experimental featuresCARAPACE_HIDDEN = "CARAPACE_HIDDEN" // show hidden commands/flagsCARAPACE_LENIENT = "CARAPACE_LENIENT" // allow unknown flagsCARAPACE_LOG = "CARAPACE_LOG" // enable loggingCARAPACE_MATCH = "CARAPACE_MATCH" // match case insensitiveCARAPACE_NOSPACE = "CARAPACE_NOSPACE" // nospace suffixesCARAPACE_SANDBOX = "CARAPACE_SANDBOX" // mock context for sandbox testsCARAPACE_TOOLTIP = "CARAPACE_TOOLTIP" // enable tooltip styleCARAPACE_UNFILTERED = "CARAPACE_UNFILTERED" // skip the final filtering stepCARAPACE_ZSH_HASH_DIRS = "CARAPACE_ZSH_HASH_DIRS" // zsh hash directoriesCLICOLOR = "CLICOLOR" // disable colorNO_COLOR = "NO_COLOR" // disable color)func () bool {return getBool(NO_COLOR) || os.Getenv(CLICOLOR) == "0"}func () bool {return getBool(CARAPACE_EXPERIMENTAL)}func () bool {return getBool(CARAPACE_LENIENT)}func () string {return os.Getenv(CARAPACE_ZSH_HASH_DIRS)}func () ( *common.Mock, error) {:= os.Getenv(CARAPACE_SANDBOX)if == "" || !isGoRun() {return nil, errors.New("no sandbox")}= json.Unmarshal([]byte(), &)return}func () bool {return getBool(CARAPACE_LOG)}func () bool {return getBool(CARAPACE_HIDDEN)}func () string {return os.Getenv(CARAPACE_COVERDIR) // custom env for GOCOVERDIR so that it works together with `-coverprofile`}func isGoRun() bool { return strings.HasPrefix(os.Args[0], os.TempDir()+"/go-build") }func () string { // see match.Matchreturn os.Getenv(CARAPACE_MATCH)}func () string {return os.Getenv(CARAPACE_NOSPACE)}func () bool {return getBool(CARAPACE_TOOLTIP)}func () string {return os.Getenv(CARAPACE_COMPLINE)}func () bool {return getBool(CARAPACE_UNFILTERED)}func getBool( string) bool {switch os.Getenv() {case "true", "1":return truedefault:return false}}
![]() |
The pages are generated with Golds v0.8.2. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds. |