diff options
author | 2024-06-17 08:13:40 +0000 | |
---|---|---|
committer | 2024-06-17 08:13:40 +0000 | |
commit | 7ab404d64335dc0b6977e9fb38140ad6fc5b91b7 (patch) | |
tree | 5c589e9a69f90ad6bc50036f5632758f1e5bf3ac /vendor/github.com/spf13/cobra/active_help.go | |
parent | [chore]: Bump golang.org/x/oauth2 from 0.20.0 to 0.21.0 (#3015) (diff) | |
download | gotosocial-7ab404d64335dc0b6977e9fb38140ad6fc5b91b7.tar.xz |
[chore]: Bump github.com/spf13/cobra from 1.8.0 to 1.8.1 (#3016)
Diffstat (limited to 'vendor/github.com/spf13/cobra/active_help.go')
-rw-r--r-- | vendor/github.com/spf13/cobra/active_help.go | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/vendor/github.com/spf13/cobra/active_help.go b/vendor/github.com/spf13/cobra/active_help.go index 5f965e057..25c30e3cc 100644 --- a/vendor/github.com/spf13/cobra/active_help.go +++ b/vendor/github.com/spf13/cobra/active_help.go @@ -17,21 +17,17 @@ package cobra import ( "fmt" "os" - "regexp" - "strings" ) const ( activeHelpMarker = "_activeHelp_ " // The below values should not be changed: programs will be using them explicitly // in their user documentation, and users will be using them explicitly. - activeHelpEnvVarSuffix = "_ACTIVE_HELP" - activeHelpGlobalEnvVar = "COBRA_ACTIVE_HELP" + activeHelpEnvVarSuffix = "ACTIVE_HELP" + activeHelpGlobalEnvVar = configEnvVarGlobalPrefix + "_" + activeHelpEnvVarSuffix activeHelpGlobalDisable = "0" ) -var activeHelpEnvVarPrefixSubstRegexp = regexp.MustCompile(`[^A-Z0-9_]`) - // AppendActiveHelp adds the specified string to the specified array to be used as ActiveHelp. // Such strings will be processed by the completion script and will be shown as ActiveHelp // to the user. @@ -60,8 +56,5 @@ func GetActiveHelpConfig(cmd *Command) string { // variable. It has the format <PROGRAM>_ACTIVE_HELP where <PROGRAM> is the name of the // root command in upper case, with all non-ASCII-alphanumeric characters replaced by `_`. func activeHelpEnvVar(name string) string { - // This format should not be changed: users will be using it explicitly. - activeHelpEnvVar := strings.ToUpper(fmt.Sprintf("%s%s", name, activeHelpEnvVarSuffix)) - activeHelpEnvVar = activeHelpEnvVarPrefixSubstRegexp.ReplaceAllString(activeHelpEnvVar, "_") - return activeHelpEnvVar + return configEnvVar(name, activeHelpEnvVarSuffix) } |