kubectl/pkg/cmd/get
Marc Khouzam b111bee570 Complete multiple resource names
This commit teaches the completion function to repeat resource names
when supported by the command. The logic checks if a resource name
has already been specified by the user and does not include it again
when repeating the completion.

For example, the get command can receive multiple pods names, therefore
with this commit we have:
  kubectl get pod pod1 [tab]
will provide completion of pod names again, but not show 'pod1' since
it is already part of the command-line.

The improvement affects the following commands:
- annotate
- apply edit-last-applied
- apply view-last-applied
- autoscale
- delete
- describe
- edit
- expose
- get
- label
- patch
- rollout history
- rollout pause
- rollout restart
- rollout resume
- rollout undo
- scale
- taint

Note that "rollout status" only accepts a single resource name, unlike
the other "rollout ..." commands; this required the creation of a
special completion function that did not repeat just for that case.

Signed-off-by: Marc Khouzam <marc.khouzam@montreal.ca>

Kubernetes-commit: 7aa5cb40316dbeb970250ee0835fbd597fd19a20
2021-10-15 15:36:09 -04:00
..
customcolumn.go fix staticcheck for kubectl pkg files 2020-09-30 15:33:29 +05:30
customcolumn_flags.go Moves kubectl get subcommand to staging 2019-10-29 15:51:00 -07:00
customcolumn_flags_test.go Use temporary directory when creating temporary file in tests 2020-07-17 10:41:16 +02:00
customcolumn_test.go Moves kubectl get subcommand to staging 2019-10-29 15:51:00 -07:00
get.go Complete multiple resource names 2021-10-15 15:36:09 -04:00
get_flags.go Add completion to the --output/-o flag 2021-10-22 15:15:23 -04:00
get_test.go Revert "Add Go tests for custom completions" 2021-05-22 20:47:14 -04:00
humanreadable_flags.go Moves kubectl get subcommand to staging 2019-10-29 15:51:00 -07:00
humanreadable_flags_test.go Moves kubectl get subcommand to staging 2019-10-29 15:51:00 -07:00
skip_printer.go Switch TableGenerator/TableConvertor interfaces to metav1 2019-11-26 13:13:25 -05:00
sorter.go handle error when parse Quantity 2021-09-18 15:05:21 +08:00
sorter_test.go Fixed sort-by not sorting Resources as expected 2021-03-21 17:44:52 -04:00
table_printer.go switch over k/k to use klog v2 2020-04-17 15:25:06 -04:00