Add --no-headers to kubectl get

This commit is contained in:
Sam Ghods
2014-10-15 18:54:46 -07:00
parent f61d434783
commit a9a8c016f7
4 changed files with 18 additions and 11 deletions

View File

@@ -57,13 +57,14 @@ Examples:
outputFormat := getFlagString(cmd, "output")
templateFile := getFlagString(cmd, "template")
selector := getFlagString(cmd, "selector")
err := kubectl.Get(out, getKubeClient(cmd).RESTClient, resource, id, selector, outputFormat, templateFile)
err := kubectl.Get(out, getKubeClient(cmd).RESTClient, resource, id, selector, outputFormat, getFlagBool(cmd, "no-headers"), templateFile)
checkErr(err)
},
}
// TODO Add an --output-version lock which can ensure that regardless of the
// server version, the client output stays the same.
cmd.Flags().StringP("output", "o", "console", "Output format: console|json|yaml|template")
cmd.Flags().Bool("no-headers", false, "When output format is console, don't print headers")
cmd.Flags().StringP("template", "t", "", "Path to template file to use when --output=template")
cmd.Flags().StringP("selector", "l", "", "Selector (label query) to filter on")
return cmd