Cleanup global functions
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 37s
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 37s
Signed-off-by: Jan Tytgat <jan.tytgat@corelayer.eu>
This commit is contained in:
@ -22,7 +22,6 @@ var (
|
|||||||
persistentPreRunE []func(cmd *cobra.Command, args []string) error // collection of PreRunE functions
|
persistentPreRunE []func(cmd *cobra.Command, args []string) error // collection of PreRunE functions
|
||||||
persistentPostRunE []func(cmd *cobra.Command, args []string) error // collection of PostRunE functions
|
persistentPostRunE []func(cmd *cobra.Command, args []string) error // collection of PostRunE functions
|
||||||
outWriter io.Writer = os.Stdout
|
outWriter io.Writer = os.Stdout
|
||||||
// version semver.Version
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func helpFuncE(cmd *cobra.Command, args []string) error {
|
func helpFuncE(cmd *cobra.Command, args []string) error {
|
||||||
@ -30,17 +29,12 @@ func helpFuncE(cmd *cobra.Command, args []string) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func normalizeFunc(f *pflag.FlagSet, name string) pflag.NormalizedName {
|
func normalizeFunc(f *pflag.FlagSet, name string) pflag.NormalizedName {
|
||||||
// switch name {
|
|
||||||
// case "no-color":
|
|
||||||
// name = "log-type"
|
|
||||||
// break
|
|
||||||
// }
|
|
||||||
return pflag.NormalizedName(name)
|
return pflag.NormalizedName(name)
|
||||||
}
|
}
|
||||||
|
|
||||||
func persistentPreRunFuncE(cmd *cobra.Command, args []string) error {
|
func persistentPreRunFuncE(cmd *cobra.Command, args []string) error {
|
||||||
slogd.SetLevel(slogd.Level(logLevelFlag))
|
slogd.SetLevel(slogd.Level(logLevelFlag))
|
||||||
// if slogd.ActiveHandler() == slogd_colored.HandlerColor && noColorFlag {
|
|
||||||
if slogd.ActiveHandler() != slogd.HandlerJSON && noColorFlag {
|
if slogd.ActiveHandler() != slogd.HandlerJSON && noColorFlag {
|
||||||
slogd.UseHandler(slogd.HandlerText)
|
slogd.UseHandler(slogd.HandlerText)
|
||||||
cmd.SetContext(slogd.WithContext(cmd.Context()))
|
cmd.SetContext(slogd.WithContext(cmd.Context()))
|
||||||
|
Reference in New Issue
Block a user