Files
kubernetes/pkg/kubectl/cmd
Kubernetes Submit Queue bf422b7b04 Merge pull request #64371 from CaoShuFeng/invalid_o
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

fix kubectl -o

Fix kubectl -o error message:
Before this change:
```
kubectl get pods -o foo
error: unable to match a printer suitable for the output format "" and the options specified: &get.PrintFlags{JSONYamlPrintFlags:(*genericclioptions.JSONYamlPrintFlags)(0x23aa610), NamePrintFlags:(*genericclioptions.NamePrintFlags)(0xc42058b4e0), TemplateFlags:(*printers.KubeTemplatePrintFlags)(0xc4206765e0), CustomColumnsFlags:(*printers.CustomColumnsPrintFlags)(0xc420676620), HumanReadableFlags:(*get.HumanPrintFlags)(0xc4204eb180), NoHeaders:(*bool)(0xc4206fefbc), OutputFormat:(*string)(0xc42058b4d0)}
```

After this change:
```
Kubectl get pods -o foo
error: unable to match a printer suitable for the output format "foo", allowed formats are: json,yaml,name,template,go-template,go-template-file,templatefile,jsonpath,jsonpath-file,custom-columns-file,custom-columns,wide
```



**What this PR does / why we need it**:

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #

**Special notes for your reviewer**:

**Release note**:

```release-note
kubectl will list all allowed print formats when an invalid format is passed.
```
2018-06-06 04:15:56 -07:00
..
2018-06-05 19:49:07 +08:00
2018-05-29 10:46:54 -04:00
2018-05-08 09:02:34 -04:00
2018-05-25 22:18:10 +02:00
2018-05-24 10:50:49 -04:00
2018-03-13 16:21:30 -04:00
2018-06-05 10:16:40 +02:00
2018-05-29 08:34:47 -04:00
2018-05-08 09:02:34 -04:00
2017-12-25 16:23:38 +08:00
2017-08-16 12:27:36 -07:00
2018-05-08 09:02:34 -04:00
2018-04-27 21:41:03 +02:00
2018-05-08 18:33:50 -04:00
2018-05-08 09:02:34 -04:00
2018-05-08 09:02:34 -04:00