avoid events for version command (#2719)

<!-- Insert PR description-->

Do not send event on call of - help or version commands
---

#### Does this PR need a docs update or release note?

- [ ]  No

#### Type of change

<!--- Please check the type of change your PR introduces: --->
- [ ] 🧹 Tech Debt/Cleanup

#### Test Plan

<!-- How will this be tested prior to merging.-->
- [ ] 💪 Manual
This commit is contained in:
neha_gupta 2023-03-08 16:52:42 +05:30 committed by GitHub
parent 1b4646a4b4
commit 35c21ec1bf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -61,13 +61,14 @@ func preRun(cc *cobra.Command, args []string) error {
print.Info(ctx, "Logging to file: "+logger.LogFile)
}
avoidTheseCommands = []string{
"help for corso",
avoidTheseDescription := []string{
"Initialize a repository.",
"Initialize a S3 repository",
"Help about any command",
"Free, Secure, Open-Source Backup for M365.",
}
if !slices.Contains(avoidTheseCommands, cc.Short) {
if !slices.Contains(avoidTheseDescription, cc.Short) {
cfg, err := config.GetConfigRepoDetails(ctx, true, nil)
if err != nil {
log.Error("Error while getting config info to run command: ", cc.Use)