Merge pull request #12730 from eparis/bash-completions-delete-label

bashcompletions: suggest resources to delete in kubectl delete
This commit is contained in:
Robert Bailey
2015-08-17 13:52:53 -07:00
2 changed files with 19 additions and 0 deletions

View File

@@ -58,6 +58,9 @@ $ kubectl delete pods --all`
)
func NewCmdDelete(f *cmdutil.Factory, out io.Writer) *cobra.Command {
p := kubectl.NewHumanReadablePrinter(false, false, false, []string{})
validArgs := p.HandledResources()
cmd := &cobra.Command{
Use: "delete ([-f FILENAME] | TYPE [(NAME | -l label | --all)])",
Short: "Delete resources by filenames, stdin, resources and names, or by resources and label selector.",
@@ -68,6 +71,7 @@ func NewCmdDelete(f *cmdutil.Factory, out io.Writer) *cobra.Command {
err := RunDelete(f, out, cmd, args)
cmdutil.CheckErr(err)
},
ValidArgs: validArgs,
}
usage := "Filename, directory, or URL to a file containing the resource to delete."
kubectl.AddJsonFilenameFlag(cmd, usage)