Skip to content

Commit

Permalink
Update docs based on new spf13/cobra
Browse files Browse the repository at this point in the history
  • Loading branch information
eparis committed Sep 4, 2015
1 parent c6ff44c commit bf7646b
Show file tree
Hide file tree
Showing 63 changed files with 44 additions and 292 deletions.
77 changes: 13 additions & 64 deletions contrib/completions/bash/kubectl
Original file line number Diff line number Diff line change
@@ -1,13 +1,20 @@
#!/bin/bash


__debug()
{
if [[ -n ${BASH_COMP_DEBUG_FILE} ]]; then
echo "$*" >> "${BASH_COMP_DEBUG_FILE}"
fi
}

# Homebrew on Macs have version 1.3 of bash-completion which doesn't include
# _init_completion. This is a very minimal version of that function.
__my_init_completion()
{
COMPREPLY=()
_get_comp_words_by_ref cur prev words cword
}

__index_of_word()
{
local w word=$1
Expand Down Expand Up @@ -260,8 +267,6 @@ _kubectl_get()
two_word_flags+=("-f")
flags_with_completion+=("-f")
flags_completion+=("__handle_filename_extension_flag json|stdin|yaml|yml")
flags+=("--help")
flags+=("-h")
flags+=("--label-columns=")
two_word_flags+=("-L")
flags+=("--no-headers")
Expand Down Expand Up @@ -317,8 +322,6 @@ _kubectl_describe()
two_word_flags+=("-f")
flags_with_completion+=("-f")
flags_completion+=("__handle_filename_extension_flag json|stdin|yaml|yml")
flags+=("--help")
flags+=("-h")
flags+=("--selector=")
two_word_flags+=("-l")

Expand Down Expand Up @@ -354,8 +357,6 @@ _kubectl_create()
two_word_flags+=("-f")
flags_with_completion+=("-f")
flags_completion+=("__handle_filename_extension_flag json|stdin|yaml|yml")
flags+=("--help")
flags+=("-h")
flags+=("--output=")
two_word_flags+=("-o")
flags+=("--validate")
Expand Down Expand Up @@ -385,8 +386,6 @@ _kubectl_replace()
flags_completion+=("__handle_filename_extension_flag json|stdin|yaml|yml")
flags+=("--force")
flags+=("--grace-period=")
flags+=("--help")
flags+=("-h")
flags+=("--output=")
two_word_flags+=("-o")
flags+=("--timeout=")
Expand Down Expand Up @@ -414,8 +413,6 @@ _kubectl_patch()
two_word_flags+=("-f")
flags_with_completion+=("-f")
flags_completion+=("__handle_filename_extension_flag json|stdin|yaml|yml")
flags+=("--help")
flags+=("-h")
flags+=("--output=")
two_word_flags+=("-o")
flags+=("--patch=")
Expand Down Expand Up @@ -446,8 +443,6 @@ _kubectl_delete()
flags_with_completion+=("-f")
flags_completion+=("__handle_filename_extension_flag json|stdin|yaml|yml")
flags+=("--grace-period=")
flags+=("--help")
flags+=("-h")
flags+=("--ignore-not-found")
flags+=("--output=")
two_word_flags+=("-o")
Expand Down Expand Up @@ -487,8 +482,6 @@ _kubectl_namespace()
flags_with_completion=()
flags_completion=()

flags+=("--help")
flags+=("-h")

must_have_one_flag=()
must_have_one_noun=()
Expand All @@ -508,8 +501,6 @@ _kubectl_logs()
two_word_flags+=("-c")
flags+=("--follow")
flags+=("-f")
flags+=("--help")
flags+=("-h")
flags+=("--interactive")
flags+=("--previous")
flags+=("-p")
Expand All @@ -536,8 +527,6 @@ _kubectl_rolling-update()
two_word_flags+=("-f")
flags_with_completion+=("-f")
flags_completion+=("__handle_filename_extension_flag json|stdin|yaml|yml")
flags+=("--help")
flags+=("-h")
flags+=("--image=")
flags+=("--no-headers")
flags+=("--output=")
Expand Down Expand Up @@ -578,8 +567,6 @@ _kubectl_scale()
two_word_flags+=("-f")
flags_with_completion+=("-f")
flags_completion+=("__handle_filename_extension_flag json|stdin|yaml|yml")
flags+=("--help")
flags+=("-h")
flags+=("--output=")
two_word_flags+=("-o")
flags+=("--replicas=")
Expand All @@ -603,8 +590,6 @@ _kubectl_attach()

flags+=("--container=")
two_word_flags+=("-c")
flags+=("--help")
flags+=("-h")
flags+=("--stdin")
flags+=("-i")
flags+=("--tty")
Expand All @@ -626,8 +611,6 @@ _kubectl_exec()

flags+=("--container=")
two_word_flags+=("-c")
flags+=("--help")
flags+=("-h")
flags+=("--pod=")
two_word_flags+=("-p")
flags+=("--stdin")
Expand All @@ -649,8 +632,6 @@ _kubectl_port-forward()
flags_with_completion=()
flags_completion=()

flags+=("--help")
flags+=("-h")
flags+=("--pod=")
two_word_flags+=("-p")

Expand All @@ -672,8 +653,6 @@ _kubectl_proxy()
flags+=("--accept-paths=")
flags+=("--api-prefix=")
flags+=("--disable-filter")
flags+=("--help")
flags+=("-h")
flags+=("--port=")
two_word_flags+=("-p")
flags+=("--reject-methods=")
Expand Down Expand Up @@ -703,8 +682,6 @@ _kubectl_run()
flags+=("--command")
flags+=("--dry-run")
flags+=("--generator=")
flags+=("--help")
flags+=("-h")
flags+=("--hostport=")
flags+=("--image=")
flags+=("--labels=")
Expand Down Expand Up @@ -750,8 +727,6 @@ _kubectl_stop()
flags_with_completion+=("-f")
flags_completion+=("__handle_filename_extension_flag json|stdin|yaml|yml")
flags+=("--grace-period=")
flags+=("--help")
flags+=("-h")
flags+=("--ignore-not-found")
flags+=("--output=")
two_word_flags+=("-o")
Expand Down Expand Up @@ -784,8 +759,6 @@ _kubectl_expose()
flags_with_completion+=("-f")
flags_completion+=("__handle_filename_extension_flag json|stdin|yaml|yml")
flags+=("--generator=")
flags+=("--help")
flags+=("-h")
flags+=("--labels=")
two_word_flags+=("-l")
flags+=("--name=")
Expand Down Expand Up @@ -829,8 +802,6 @@ _kubectl_label()
two_word_flags+=("-f")
flags_with_completion+=("-f")
flags_completion+=("__handle_filename_extension_flag json|stdin|yaml|yml")
flags+=("--help")
flags+=("-h")
flags+=("--no-headers")
flags+=("--output=")
two_word_flags+=("-o")
Expand Down Expand Up @@ -884,8 +855,6 @@ _kubectl_annotate()
two_word_flags+=("-f")
flags_with_completion+=("-f")
flags_completion+=("__handle_filename_extension_flag json|stdin|yaml|yml")
flags+=("--help")
flags+=("-h")
flags+=("--overwrite")
flags+=("--resource-version=")

Expand All @@ -904,8 +873,6 @@ _kubectl_config_view()
flags_completion=()

flags+=("--flatten")
flags+=("--help")
flags+=("-h")
flags+=("--merge")
flags+=("--minify")
flags+=("--no-headers")
Expand Down Expand Up @@ -936,8 +903,6 @@ _kubectl_config_set-cluster()
flags+=("--api-version=")
flags+=("--certificate-authority=")
flags+=("--embed-certs")
flags+=("--help")
flags+=("-h")
flags+=("--insecure-skip-tls-verify")
flags+=("--server=")

Expand All @@ -958,8 +923,6 @@ _kubectl_config_set-credentials()
flags+=("--client-certificate=")
flags+=("--client-key=")
flags+=("--embed-certs")
flags+=("--help")
flags+=("-h")
flags+=("--password=")
flags+=("--token=")
flags+=("--username=")
Expand All @@ -979,8 +942,6 @@ _kubectl_config_set-context()
flags_completion=()

flags+=("--cluster=")
flags+=("--help")
flags+=("-h")
flags+=("--namespace=")
flags+=("--user=")

Expand All @@ -998,8 +959,6 @@ _kubectl_config_set()
flags_with_completion=()
flags_completion=()

flags+=("--help")
flags+=("-h")

must_have_one_flag=()
must_have_one_noun=()
Expand All @@ -1015,8 +974,6 @@ _kubectl_config_unset()
flags_with_completion=()
flags_completion=()

flags+=("--help")
flags+=("-h")

must_have_one_flag=()
must_have_one_noun=()
Expand All @@ -1032,8 +989,6 @@ _kubectl_config_use-context()
flags_with_completion=()
flags_completion=()

flags+=("--help")
flags+=("-h")

must_have_one_flag=()
must_have_one_noun=()
Expand All @@ -1056,8 +1011,6 @@ _kubectl_config()
flags_with_completion=()
flags_completion=()

flags+=("--help")
flags+=("-h")
flags+=("--kubeconfig=")

must_have_one_flag=()
Expand All @@ -1074,8 +1027,6 @@ _kubectl_cluster-info()
flags_with_completion=()
flags_completion=()

flags+=("--help")
flags+=("-h")

must_have_one_flag=()
must_have_one_noun=()
Expand All @@ -1091,8 +1042,6 @@ _kubectl_api-versions()
flags_with_completion=()
flags_completion=()

flags+=("--help")
flags+=("-h")

must_have_one_flag=()
must_have_one_noun=()
Expand All @@ -1110,8 +1059,6 @@ _kubectl_version()

flags+=("--client")
flags+=("-c")
flags+=("--help")
flags+=("-h")

must_have_one_flag=()
must_have_one_noun=()
Expand Down Expand Up @@ -1157,8 +1104,6 @@ _kubectl()
flags+=("--client-key=")
flags+=("--cluster=")
flags+=("--context=")
flags+=("--help")
flags+=("-h")
flags+=("--insecure-skip-tls-verify")
flags+=("--kubeconfig=")
flags+=("--log-backtrace-at=")
Expand All @@ -1184,7 +1129,11 @@ _kubectl()
__start_kubectl()
{
local cur prev words cword
_init_completion -s || return
if declare -F _init_completions >/dev/null 2>&1; then
_init_completion -s || return
else
__my_init_completion || return
fi

local c=0
local flags=()
Expand Down
4 changes: 0 additions & 4 deletions docs/man/man1/kubectl-annotate.1
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,6 @@ resourcequotas (quota) or secrets.
\fB\-f\fP, \fB\-\-filename\fP=[]
Filename, directory, or URL to a file identifying the resource to update the annotation

.PP
\fB\-h\fP, \fB\-\-help\fP=false
help for annotate

.PP
\fB\-\-overwrite\fP=false
If true, allow annotations to be overwritten, otherwise reject annotation updates that overwrite existing annotations.
Expand Down
6 changes: 0 additions & 6 deletions docs/man/man1/kubectl-api-versions.1
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,6 @@ kubectl api\-versions \- Print available API versions.
Print available API versions.


.SH OPTIONS
.PP
\fB\-h\fP, \fB\-\-help\fP=false
help for api\-versions


.SH OPTIONS INHERITED FROM PARENT COMMANDS
.PP
\fB\-\-alsologtostderr\fP=false
Expand Down
4 changes: 0 additions & 4 deletions docs/man/man1/kubectl-attach.1
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@ Attach to a a process that is already running inside an existing container.
\fB\-c\fP, \fB\-\-container\fP=""
Container name

.PP
\fB\-h\fP, \fB\-\-help\fP=false
help for attach

.PP
\fB\-i\fP, \fB\-\-stdin\fP=false
Pass stdin to the container
Expand Down
6 changes: 0 additions & 6 deletions docs/man/man1/kubectl-cluster-info.1
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,6 @@ kubectl cluster\-info \- Display cluster info
Display addresses of the master and services with label kubernetes.io/cluster\-service=true


.SH OPTIONS
.PP
\fB\-h\fP, \fB\-\-help\fP=false
help for cluster\-info


.SH OPTIONS INHERITED FROM PARENT COMMANDS
.PP
\fB\-\-alsologtostderr\fP=false
Expand Down
4 changes: 0 additions & 4 deletions docs/man/man1/kubectl-config-set-cluster.1
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,6 @@ Specifying a name that already exists will merge new fields on top of existing v
\fB\-\-embed\-certs\fP=false
embed\-certs for the cluster entry in kubeconfig

.PP
\fB\-h\fP, \fB\-\-help\fP=false
help for set\-cluster

.PP
\fB\-\-insecure\-skip\-tls\-verify\fP=false
insecure\-skip\-tls\-verify for the cluster entry in kubeconfig
Expand Down
4 changes: 0 additions & 4 deletions docs/man/man1/kubectl-config-set-context.1
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@ Specifying a name that already exists will merge new fields on top of existing v
\fB\-\-cluster\fP=""
cluster for the context entry in kubeconfig

.PP
\fB\-h\fP, \fB\-\-help\fP=false
help for set\-context

.PP
\fB\-\-namespace\fP=""
namespace for the context entry in kubeconfig
Expand Down
4 changes: 0 additions & 4 deletions docs/man/man1/kubectl-config-set-credentials.1
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,6 @@ Bearer token and basic auth are mutually exclusive.
\fB\-\-embed\-certs\fP=false
embed client cert/key for the user entry in kubeconfig

.PP
\fB\-h\fP, \fB\-\-help\fP=false
help for set\-credentials

.PP
\fB\-\-password\fP=""
password for the user entry in kubeconfig
Expand Down
Loading

0 comments on commit bf7646b

Please sign in to comment.