Skip to content

Commit dbe97f7

Browse files
authored
Merge pull request #14 from RaghavRoy145/silence-errors
Fix: Print tool errors only once
2 parents 63773f8 + e7772ea commit dbe97f7

File tree

8 files changed

+8
-0
lines changed

8 files changed

+8
-0
lines changed

cmd/audit.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ func getDefaultKubernetesDirectory() string {
5151

5252
func init() {
5353
auditCmd.Flags().StringVar(&kubernetesDirectory, "kubernetes-directory", getDefaultKubernetesDirectory(), "path to kubernetes directory")
54+
auditCmd.SilenceErrors = true
5455
rootCmd.AddCommand(auditCmd)
5556
}
5657

cmd/checkurl.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ var yamlFile string
3232

3333
func init() {
3434
checkURLsCmd.Flags().StringVar(&yamlFile, "yaml-file", "sigs.yaml", "validate urls in this yaml file")
35+
checkURLsCmd.SilenceErrors = true
3536
rootCmd.AddCommand(checkURLsCmd)
3637
}
3738

cmd/export.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ var outputFile string
5353

5454
func init() {
5555
exportCmd.Flags().StringVar(&outputFile, "output", "export.csv", "output file path")
56+
exportCmd.SilenceErrors = true
5657
rootCmd.AddCommand(exportCmd)
5758
}
5859

cmd/labels.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ var labelsFile string
5252

5353
func init() {
5454
labelsCmd.Flags().StringVar(&labelsFile, "output", "labels.csv", "output file path")
55+
labelsCmd.SilenceErrors = true
5556
rootCmd.AddCommand(labelsCmd)
5657
}
5758

cmd/prettify.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ var prettifyCmd = &cobra.Command{
8989
}
9090

9191
func init() {
92+
prettifyCmd.SilenceErrors = true
9293
rootCmd.AddCommand(prettifyCmd)
9394
}
9495

cmd/prune.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ func init() {
4747
pruneCmd.Flags().StringVar(&periodDS, "period-devstats", "y", "one of \"y\" (year) \"q\" (quarter) \"m\" (month) ")
4848
pruneCmd.Flags().StringSliceVar(&excludeFiles, "exclude-files", []string{}, "do not update these OWNERS files")
4949
rootCmd.CompletionOptions.DisableDefaultCmd = true
50+
pruneCmd.SilenceErrors = true
5051
rootCmd.AddCommand(pruneCmd)
5152
}
5253

cmd/validate.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,5 +140,6 @@ func validateOwnersFilesInGroups(groupMap *map[string][]utils.Group) (map[string
140140
}
141141

142142
func init() {
143+
validateCmd.SilenceErrors = true
143144
rootCmd.AddCommand(validateCmd)
144145
}

cmd/version.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import (
2323
)
2424

2525
func init() {
26+
versionCmd.SilenceErrors = true
2627
rootCmd.AddCommand(versionCmd)
2728
}
2829

0 commit comments

Comments
 (0)