kubectl/pkg/cmd
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
..
annotate cleanup description on deprecated include-uninitialized flag 2021-07-26 11:14:55 +08:00
apiresources Minor adjustments to descriptions and example text 2021-07-06 15:05:26 -04:00
apply cleanup description on deprecated include-uninitialized flag 2021-07-26 11:14:55 +08:00
attach Minor adjustments to descriptions and example text 2021-07-06 15:05:26 -04:00
auth Provide reference to impersonation options for kubectl auth can-i command. 2021-07-19 21:08:04 -07:00
autoscale Minor adjustments to descriptions and example text 2021-07-06 15:05:26 -04:00
certificates Minor adjustments to descriptions and example text 2021-07-06 15:05:26 -04:00
clusterinfo Minor adjustments to descriptions and example text 2021-07-06 15:05:26 -04:00
completion Adds the PowerShell completion generation (#103758) 2021-08-25 22:29:23 -05:00
config remove Factory that not used 2021-05-17 16:56:12 +08:00
cp Minor adjustments to descriptions and example text 2021-07-06 15:05:26 -04:00
create Improve configmap test 2021-09-03 15:54:11 -04:00
debug Add backwards compatibility for kubectl debug 2021-06-28 18:19:50 +02:00
delete cleanup description on deprecated include-uninitialized flag 2021-07-26 11:14:55 +08:00
describe Fix typo in kubectl describe pods example 2021-08-26 21:00:18 -03:00
diff Add diff command return status code greater than 1 when flags invalid 2021-10-04 13:02:34 +03:00
drain Minor adjustments to descriptions and example text 2021-07-06 15:05:26 -04:00
edit Minor adjustments to descriptions and example text 2021-07-06 15:05:26 -04:00
exec Minor adjustments to descriptions and example text 2021-07-06 15:05:26 -04:00
explain Minor adjustments to descriptions and example text 2021-07-06 15:05:26 -04:00
expose Minor adjustments to descriptions and example text 2021-07-06 15:05:26 -04:00
get Complete multiple resource names 2021-10-15 15:36:09 -04:00
help Move pkg/kubectl/cmd/{command} to staging 2019-08-01 11:01:40 -07:00
kustomize Manually update kustomize attachment points. 2021-07-01 17:10:28 -07:00
label cleanup description on deprecated include-uninitialized flag 2021-07-26 11:14:55 +08:00
logs Revert "Add Go tests for custom completions" 2021-05-22 20:47:14 -04:00
options cleanup: use i18n.T on all command descriptions 2020-10-09 13:16:13 +02:00
patch Minor adjustments to descriptions and example text 2021-07-06 15:05:26 -04:00
plugin remove Factory that not used 2021-05-17 16:56:12 +08:00
portforward Minor adjustments to descriptions and example text 2021-07-06 15:05:26 -04:00
proxy Minor adjustments to descriptions and example text 2021-07-06 15:05:26 -04:00
replace Minor adjustments to descriptions and example text 2021-07-06 15:05:26 -04:00
rollout Complete multiple resource names 2021-10-15 15:36:09 -04:00
run Minor improvements in 'kubectl run' flag help 2021-10-06 16:57:47 +02:00
scale Minor adjustments to descriptions and example text 2021-07-06 15:05:26 -04:00
set add unit tests for updateEnv 2021-09-08 10:49:15 +08:00
taint fix: 81134: display conflicted taint without a json representation. 2021-07-29 23:26:07 +00:00
testing generated: Run hack/update-gofmt.sh 2021-08-12 17:13:11 -04:00
top Minor adjustments to descriptions and example text 2021-07-06 15:05:26 -04:00
util Complete multiple resource names 2021-10-15 15:36:09 -04:00
version Fix kubectl version unit test 2021-07-27 11:46:45 -06:00
wait Minor adjustments to descriptions and example text 2021-07-06 15:05:26 -04:00
alpha.go remove Factory that not used 2021-05-17 16:56:12 +08:00
cmd.go Ignore flags that could precede the Cobra command 2021-09-20 18:20:49 -04:00
cmd_test.go Ignore flags that could precede the Cobra command 2021-09-20 18:20:49 -04:00
profiling.go Move the remaining kubectl bits to k8s.io/kubectl 2020-11-03 22:11:39 +01:00