Commit Graph

31 Commits (c582a37cae02b4d1a850e6668ea8ea0a81dcd204)

Author SHA1 Message Date
Xianglin Gao 7398219549 improve kubectl completion help
Signed-off-by: Xianglin Gao <xianglin.gxl@alibaba-inc.com>
2018-06-21 14:42:33 +08:00
juanvallejo 3dc952e761
fix kubectl_filedir completion 2018-03-13 16:21:30 -04:00
Kubernetes Submit Queue 048757b8a5
Merge pull request #53631 from dixudx/enforce_cobra_required_flags
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>.

update vendor spf13/cobra to enforce required flags

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

spf13/cobra#502 has enforced checking flags that marked as required, an error will be raised if unset.

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*:fixes #54855
xref #48400
fixes kubernetes/kubectl#121 

**Special notes for your reviewer**:
/assign @liggitt @eparis 

**Release note**:

```release-note
kubectl now enforces required flags at a more fundamental level
```
2018-01-18 02:00:27 -08:00
Anish Ramasekar c322f1d065
fix typos in kubectl pkg 2018-01-05 21:04:44 -06:00
Di Xu 1c715d51c4 some code change
fix wrong required flags

disable the addition of [flags] to the usage, use customized useline

fix function rename
2017-12-25 16:23:38 +08:00
Christoph Blecker 0153f8de1a
Update help/example for kubectl completion 2017-08-18 14:29:42 -07:00
Christoph Blecker 70b942d663
Allow zsh completion to be autoloaded by compinit 2017-08-18 14:29:26 -07:00
ymqytw b776df8a20 move i18n to kubectl/util 2017-08-16 12:27:36 -07:00
Kazuki Suda 3b00b9a5da Fix a bug that --flag=val causes completion error in zsh
Remove __kubectl_declare

`declare -F` is already replaced to `whence -w` by __kubectl_convert_bash_to_zsh().
2017-07-31 23:12:55 +09:00
Alexander Campbell 6fd36c10ad kubectl/cmd: many small refactors
* Rename variables and functions to match Go convention.
   For example, UsageError --> UsageErrorf.
 * Remove redundant or unreachable code.
 * Simplify some utility functions (no functionality changes).
 * Fix hanging 'if { return } else { return }' constructs.
 * Fix several incorrect printf verbs.
2017-06-27 16:25:20 -07:00
Kubernetes Submit Queue 19d722671b Merge pull request #43297 from mvdan/kubectl-params
Automatic merge from submit-queue

kubectl/cmd: remove a bunch of unused parameters

Found with github.com/mvdan/unparam.

**Release note**: NONE
2017-04-13 04:07:21 -07:00
Brendan Burns 79f51923d3 Extract a bunch more strings from kubectl 2017-04-06 20:12:50 -07:00
Daniel Martí 810dbc5e98 kubectl/cmd: remove a bunch of unused parameters
Found with github.com/mvdan/unparam.
2017-04-04 10:36:30 +01:00
elipapa 136c90a7bf solving unknown file attribute error while sourcing completions
sourcing the file with `zsh` > 4 resulted in an `unknown file attribute`.
More details at http://stackoverflow.com/questions/37220495/zsh-unknown-file-attribute

replacing $@ with $* for get_comp_words
as suggested by @sttts worked to resolve the issue
2017-02-24 16:29:41 +00:00
Brendan Burns d9c4a289a6 Extract strings for translation. 2017-02-06 22:32:01 -08:00
Maciej Szulik 56147c5174 Allow setting copyright header file for generated completions 2017-01-19 16:06:20 +01:00
Phillip Wittrock dc2fffe5d4 Improve kubectl help with examples. 2017-01-06 13:35:43 -08:00
Kubernetes Submit Queue 2a89179046 Merge pull request #39070 from shiywang/remove_unused_param
Automatic merge from submit-queue (batch tested with PRs 39022, 39331, 39070, 39344)

remove unused parameter
2017-01-03 10:32:22 -08:00
Shiyang Wang 9d037a0ab6 remove unused parameter 2016-12-21 16:09:51 +08:00
Matt Rickard 0497ffb9c6 Add boilerplate to kubectl completion bash
Small refactor to make kubectl bash and zsh completion share
boilerplate.  Previously the boilerplate was not included in the bash
script.
2016-10-21 14:07:38 -07:00
Fabiano Franz f6d1ac72a0 Use our own normalizers for cmd examples and descriptions 2016-10-17 11:49:55 -02:00
Kubernetes Submit Queue 786cc3ef6c Merge pull request #32142 from juanvallejo/jvallejo_bugfix/remove-compinit-call-zsh-completions
Automatic merge from submit-queue

remove call to compinit in zsh completion output

**Release note**:
```release-note
release-note-none
```

Fixes: https://github.com/kubernetes/kubernetes/issues/32029
Fixes:
https://github.com/kubernetes/kubernetes/issues/27538#issuecomment-238574035

The zsh completion output makes a call to "compinit" which causes the
zsh completion system to re-initialize every time `<root_cmd> completion zsh`
is sourced, overwriting any settings already applied to other commands.
This in-turn caused other commands' completions to break (such as git,
gcloud, vim) causing an error "function definition file not found" to
be returned any time a tab-completion was attempted.

This patch removes the call to `compinit` in the zsh completion output,
causing no behavioral changes to the existing `completion` command, but
fixing any issues that were caused after sourcing its output.
2016-10-13 16:33:09 -07:00
juanvallejo 4bf980967a remove call to compinit in zsh completion output
Fixes: https://github.com/kubernetes/kubernetes/issues/32029
Fixes:
https://github.com/kubernetes/kubernetes/issues/27538#issuecomment-238574035

The zsh completion output makes a call to "compinit" which causes the
zsh completion system to re-initialize every time `<root_cmd> completion zsh`
is sourced, overwriting any settings already applied to other commands.
This in-turn caused other commands' completions to break (such as git,
gcloud, vim) causing an error "function definition file not found" to
be returned any time a tab-completion was attempted.

This patch removes the call to `compinit` in the zsh completion output,
causing no behavioral changes to the existing `completion` command, but
fixing any issues that were caused after sourcing its output.
2016-10-13 16:47:20 -04:00
Kubernetes Submit Queue f2ca99ed2c Merge pull request #32104 from lojies/usededentforcompletion
Automatic merge from submit-queue

Use dedent for completion.go
2016-10-13 10:07:54 -07:00
AdoHe b2280a646a update various commands to adapt the new Factory interface 2016-10-13 21:01:14 +08:00
lojies b118db0a17 Use dedent for completion.go 2016-09-06 15:49:20 +08:00
ohmystack 1ea3da1eb6 Fix named pipe in kubectl zsh completion
In zsh and bash, a multi-line named pipe, who is wrapped by
parenthesis, is possible to mismatch the right parenthesis, even that
parenthesis is in a here-document. So, we move the code into a
function, and use an inline named pipe.

Signed-off-by: ohmystack <jiangjun1990@gmail.com>
2016-08-23 01:42:05 +08:00
juanvallejo 9eb98cfb58 Add zsh compatibility note `completion` cmd help 2016-08-11 13:49:44 -04:00
Eli Young f2f80a097d Reformat kubectl completion example text
This makes the description wrap properly in 80-character terminals.
2016-07-06 13:18:33 -07:00
David McMahon ef0c9f0c5b Remove "All rights reserved" from all the headers. 2016-06-29 17:47:36 -07:00
Dr. Stefan Schimanski a79a420fde Move shell completion generation into 'kubectl completion' command 2016-05-30 07:23:36 +02:00