Implement 'kubectl get ... -o wide'

This commit is contained in:
Janet Kuo
2015-06-29 11:36:06 -07:00
parent 686f5a3084
commit 682734bcc7
19 changed files with 179 additions and 102 deletions

View File

@@ -275,6 +275,15 @@ func GetFlagStringList(cmd *cobra.Command, flag string) util.StringList {
return *f.Value.(*util.StringList)
}
// GetWideFlag is used to determine if "-o wide" is used
func GetWideFlag(cmd *cobra.Command) bool {
f := cmd.Flags().Lookup("output")
if f.Value.String() == "wide" {
return true
}
return false
}
func GetFlagBool(cmd *cobra.Command, flag string) bool {
f := getFlag(cmd, flag)
result, err := strconv.ParseBool(f.Value.String())