cleanup some dead kubectl code and narrow scope of helpers

This commit is contained in:
David Eads
2018-05-29 09:57:15 -04:00
parent e3a4104479
commit 207e9d1d90
22 changed files with 18 additions and 447 deletions

View File

@@ -300,16 +300,6 @@ func IsFilenameSliceEmpty(filenames []string) bool {
return len(filenames) == 0
}
// Whether this cmd need watching objects.
func isWatch(cmd *cobra.Command) bool {
if w, err := cmd.Flags().GetBool("watch"); err == nil && w {
return true
}
wo, err := cmd.Flags().GetBool("watch-only")
return err == nil && wo
}
func GetFlagString(cmd *cobra.Command, flag string) string {
s, err := cmd.Flags().GetString(flag)
if err != nil {
@@ -336,15 +326,6 @@ func GetFlagStringArray(cmd *cobra.Command, flag string) []string {
return s
}
// GetWideFlag is used to determine if "-o wide" is used
func GetWideFlag(cmd *cobra.Command) bool {
f := cmd.Flags().Lookup("output")
if f != nil && f.Value != nil && f.Value.String() == "wide" {
return true
}
return false
}
func GetFlagBool(cmd *cobra.Command, flag string) bool {
b, err := cmd.Flags().GetBool(flag)
if err != nil {