Rename function runFuncE to RunCatchFuncE for reuse

Signed-off-by: Jan Tytgat <jan.tytgat@corelayer.eu>
This commit is contained in:
Jan Tytgat
2025-06-03 14:15:26 +02:00
parent 7f6ea395ee
commit 4112e27ba5
2 changed files with 6 additions and 6 deletions

View File

@ -48,7 +48,7 @@ func (c Config) getRootCommand() (*cobra.Command, error) {
Long: long, Long: long,
PersistentPreRunE: persistentPreRunFuncE, PersistentPreRunE: persistentPreRunFuncE,
PersistentPostRunE: persistentPostRunFuncE, PersistentPostRunE: persistentPostRunFuncE,
RunE: runFuncE, RunE: RunCatchFuncE,
SilenceErrors: true, SilenceErrors: true,
SilenceUsage: true, SilenceUsage: true,
} }
@ -69,9 +69,9 @@ func (c Config) getRootCommand() (*cobra.Command, error) {
return cmd, nil return cmd, nil
} }
func (c Config) ParseVersion() (semver.Version, error) { // func (c Config) ParseVersion() (semver.Version, error) {
return semver.Parse(c.Version.Full) // return semver.Parse(c.Version.Full)
} // }
func (c Config) RegisterCommand(cmd Commander, f func(*cobra.Command)) { func (c Config) RegisterCommand(cmd Commander, f func(*cobra.Command)) {
appCmd.AddCommand(cmd.Initialize(f)) appCmd.AddCommand(cmd.Initialize(f))

View File

@ -96,7 +96,7 @@ func persistentPostRunFuncE(cmd *cobra.Command, args []string) error {
return nil return nil
} }
// appRunE is an empty catch function to allow overrides through persistentPreRunE // RunCatchFuncE is an empty catch function to allow overrides through persistentPreRunE
func runFuncE(cmd *cobra.Command, args []string) error { func RunCatchFuncE(cmd *cobra.Command, args []string) error {
return nil return nil
} }