Skip to content

Commit c5a44d6

Browse files
Shu Kutsuzawatk3fftk
authored andcommitted
fix: Add SilenceUsage and SilentErorrs to each command (#24)
* add silence help * add silence error * gofmt
1 parent 7b71919 commit c5a44d6

16 files changed

+32
-0
lines changed

command/banner_get.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ func NewCmdBannerGet(api sdapi.SDAPI) *cobra.Command {
2222
RunE: func(cmd *cobra.Command, args []string) error {
2323
return o.Run(cmd, args)
2424
},
25+
SilenceUsage: true,
26+
SilenceErrors: true,
2527
}
2628
return cmd
2729
}

command/banner_update.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ func NewCmdBannerUpdate(api sdapi.SDAPI) *cobra.Command {
2929
RunE: func(cmd *cobra.Command, args []string) error {
3030
return o.Run(cmd, args)
3131
},
32+
SilenceUsage: true,
33+
SilenceErrors: true,
3234
}
3335

3436
cmd.Flags().StringVarP(&id, "id", "i", "", "specify banner ID when update or delete")

command/clear.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ func NewCmdClear(config sdctl_context.SdctlConfig) *cobra.Command {
2020
RunE: func(cmd *cobra.Command, args []string) error {
2121
return o.Run(cmd, args)
2222
},
23+
SilenceUsage: true,
24+
SilenceErrors: true,
2325
}
2426
return cmd
2527
}

command/cmd.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ func NewCmd(config sdctl_context.SdctlConfig, api sdapi.SDAPI) *cobra.Command {
2424
Run: func(cmd *cobra.Command, args []string) {
2525
cmd.Help()
2626
},
27+
SilenceUsage: true,
28+
SilenceErrors: true,
2729
}
2830

2931
cmd.AddCommand(

command/context_current.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ func NewCmdContextCurrent(config sdctl_context.SdctlConfig) *cobra.Command {
1919
RunE: func(cmd *cobra.Command, args []string) error {
2020
return o.Run(cmd, args)
2121
},
22+
SilenceUsage: true,
23+
SilenceErrors: true,
2224
}
2325
return cmd
2426
}

command/context_list.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ func NewCmdContextList(config sdctl_context.SdctlConfig) *cobra.Command {
2020
RunE: func(cmd *cobra.Command, args []string) error {
2121
return o.Run(cmd, args)
2222
},
23+
SilenceUsage: true,
24+
SilenceErrors: true,
2325
}
2426
return cmd
2527
}

command/context_set.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ func NewCmdContextSet(config sdctl_context.SdctlConfig) *cobra.Command {
2020
RunE: func(cmd *cobra.Command, args []string) error {
2121
return o.Run(cmd, args)
2222
},
23+
SilenceUsage: true,
24+
SilenceErrors: true,
2325
}
2426
return cmd
2527
}

command/get_api.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ func NewCmdGetAPI(config sdctl_context.SdctlConfig) *cobra.Command {
1919
RunE: func(cmd *cobra.Command, args []string) error {
2020
return o.Run(cmd, args)
2121
},
22+
SilenceUsage: true,
23+
SilenceErrors: true,
2224
}
2325
return cmd
2426
}

command/get_build_pages.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ func NewCmdGetBuildPages(api sdapi.SDAPI) *cobra.Command {
2020
RunE: func(cmd *cobra.Command, args []string) error {
2121
return o.Run(cmd, args)
2222
},
23+
SilenceUsage: true,
24+
SilenceErrors: true,
2325
}
2426
return cmd
2527
}

command/get_jwt.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ func NewCmdGetJWT(config sdctl_context.SdctlConfig) *cobra.Command {
1919
RunE: func(cmd *cobra.Command, args []string) error {
2020
return o.Run(cmd, args)
2121
},
22+
SilenceUsage: true,
23+
SilenceErrors: true,
2224
}
2325
return cmd
2426
}

0 commit comments

Comments
 (0)