Refactor flags
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 4s
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 4s
Signed-off-by: Jan Tytgat <jan.tytgat@corelayer.eu>
This commit is contained in:
@ -50,7 +50,7 @@ func persistentPreRunFuncE(cmd *cobra.Command, args []string) error {
|
||||
slogd.FromContext(cmd.Context()).Log(cmd.Context(), slogd.LevelTrace, "executing PersistentPreRun")
|
||||
|
||||
// Make sure we can always get the version
|
||||
if versionFlag.Value || cmd.CommandPath() == strings.Join([]string{appName, versionName}, " ") {
|
||||
if versionFlag.Value || cmd.CommandPath() == strings.Join([]string{appName, versionFlagName}, " ") {
|
||||
slogd.FromContext(cmd.Context()).LogAttrs(cmd.Context(), slogd.LevelTrace, "overriding command", slog.String("old_function", runtime.FuncForPC(reflect.ValueOf(cmd.RunE).Pointer()).Name()), slog.String("new_function", runtime.FuncForPC(reflect.ValueOf(versionRunFuncE).Pointer()).Name()))
|
||||
cmd.RunE = versionRunFuncE
|
||||
return nil
|
||||
|
Reference in New Issue
Block a user