Skip to content

Commit

Permalink
lint issue fix (not relevant to the branch)
Browse files Browse the repository at this point in the history
  • Loading branch information
shireenf-ibm committed Oct 22, 2023
1 parent 671d6ec commit e4d252c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cmd/netpolicy/cmd/diff.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ func newCommandDiff() *cobra.Command {
c.Flags().StringVarP(&dir1, "dir1", "", "", "Original Resources path to be compared")
c.Flags().StringVarP(&dir2, "dir2", "", "", "New Resources path to compare with original resources path")
supportedDiffFormats := strings.Join(diff.ValidDiffFormats, ",")
c.Flags().StringVarP(&outFormat, "output", "o", common.DefaultFormat, "Required output format ("+supportedDiffFormats+")")
c.Flags().StringVarP(&outFormat, "output", "o", common.DefaultFormat, getOutputFormatDescription(supportedDiffFormats))
// out file
c.Flags().StringVarP(&outFile, "file", "f", "", "Write output to specified file")
return c
Expand Down
6 changes: 5 additions & 1 deletion cmd/netpolicy/cmd/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ var (
outFile string // output file
)

func getOutputFormatDescription(validFormats string) string {
return fmt.Sprintf("Required output format (%s)", validFormats)
}

func runListCommand() error {
var conns []connlist.Peer2PeerConnection
var err error
Expand Down Expand Up @@ -131,7 +135,7 @@ defined`,
"Focus connections of specified workload in the output (<workload-name> or <workload-namespace/workload-name>)")
// output format - default txt
supportedFormats := strings.Join(connlist.ValidFormats, ",")
c.Flags().StringVarP(&output, "output", "o", common.DefaultFormat, "Required output format ("+supportedFormats+")")
c.Flags().StringVarP(&output, "output", "o", common.DefaultFormat, getOutputFormatDescription(supportedFormats))
// out file
c.Flags().StringVarP(&outFile, "file", "f", "", "Write output to specified file")
return c
Expand Down

0 comments on commit e4d252c

Please sign in to comment.