mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-13 18:43:34 +00:00
rebase: update kubernetes and libraries to v1.22.0 version
Kubernetes v1.22 version has been released and this update ceph csi dependencies to use the same version. Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
This commit is contained in:
committed by
mergify[bot]
parent
e077c1fdf5
commit
aa698bc3e1
19
vendor/k8s.io/component-base/cli/flag/sectioned.go
generated
vendored
19
vendor/k8s.io/component-base/cli/flag/sectioned.go
generated
vendored
@ -22,9 +22,14 @@ import (
|
||||
"io"
|
||||
"strings"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
"github.com/spf13/pflag"
|
||||
)
|
||||
|
||||
const (
|
||||
usageFmt = "Usage:\n %s\n"
|
||||
)
|
||||
|
||||
// NamedFlagSets stores named flag sets in the order of calling FlagSet.
|
||||
type NamedFlagSets struct {
|
||||
// Order is an ordered list of flag set names.
|
||||
@ -84,3 +89,17 @@ func PrintSections(w io.Writer, fss NamedFlagSets, cols int) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// SetUsageAndHelpFunc set both usage and help function.
|
||||
// Print the flag sets we need instead of all of them.
|
||||
func SetUsageAndHelpFunc(cmd *cobra.Command, fss NamedFlagSets, cols int) {
|
||||
cmd.SetUsageFunc(func(cmd *cobra.Command) error {
|
||||
fmt.Fprintf(cmd.OutOrStderr(), usageFmt, cmd.UseLine())
|
||||
PrintSections(cmd.OutOrStderr(), fss, cols)
|
||||
return nil
|
||||
})
|
||||
cmd.SetHelpFunc(func(cmd *cobra.Command, args []string) {
|
||||
fmt.Fprintf(cmd.OutOrStdout(), "%s\n\n"+usageFmt, cmd.Long, cmd.UseLine())
|
||||
PrintSections(cmd.OutOrStdout(), fss, cols)
|
||||
})
|
||||
}
|
||||
|
Reference in New Issue
Block a user