mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-28 21:13:35 +00:00
Update bash completions
Because we updated cobra, we get a better set of bash completions
This commit is contained in:
parent
1f702138b8
commit
930f8645b5
@ -4,7 +4,7 @@
|
|||||||
__debug()
|
__debug()
|
||||||
{
|
{
|
||||||
if [[ -n ${BASH_COMP_DEBUG_FILE} ]]; then
|
if [[ -n ${BASH_COMP_DEBUG_FILE} ]]; then
|
||||||
echo "$*" >> ${BASH_COMP_DEBUG_FILE}
|
echo "$*" >> "${BASH_COMP_DEBUG_FILE}"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -75,6 +75,13 @@ __handle_reply()
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# The arguments should be in the form "ext1|ext2|extn"
|
||||||
|
__handle_filename_extension_flag()
|
||||||
|
{
|
||||||
|
local ext="$1"
|
||||||
|
_filedir "@(${ext})"
|
||||||
|
}
|
||||||
|
|
||||||
__handle_flag()
|
__handle_flag()
|
||||||
{
|
{
|
||||||
__debug "${FUNCNAME}: c is $c words[c] is ${words[c]}"
|
__debug "${FUNCNAME}: c is $c words[c] is ${words[c]}"
|
||||||
@ -297,10 +304,10 @@ _kubectl_create()
|
|||||||
|
|
||||||
flags+=("--filename=")
|
flags+=("--filename=")
|
||||||
flags_with_completion+=("--filename")
|
flags_with_completion+=("--filename")
|
||||||
flags_completion+=("_filedir '@(json|yaml|yml)'")
|
flags_completion+=("__handle_filename_extension_flag json|yaml|yml")
|
||||||
two_word_flags+=("-f")
|
two_word_flags+=("-f")
|
||||||
flags_with_completion+=("-f")
|
flags_with_completion+=("-f")
|
||||||
flags_completion+=("_filedir '@(json|yaml|yml)'")
|
flags_completion+=("__handle_filename_extension_flag json|yaml|yml")
|
||||||
flags+=("--help")
|
flags+=("--help")
|
||||||
flags+=("-h")
|
flags+=("-h")
|
||||||
|
|
||||||
@ -322,10 +329,10 @@ _kubectl_update()
|
|||||||
|
|
||||||
flags+=("--filename=")
|
flags+=("--filename=")
|
||||||
flags_with_completion+=("--filename")
|
flags_with_completion+=("--filename")
|
||||||
flags_completion+=("_filedir '@(json|yaml|yml)'")
|
flags_completion+=("__handle_filename_extension_flag json|yaml|yml")
|
||||||
two_word_flags+=("-f")
|
two_word_flags+=("-f")
|
||||||
flags_with_completion+=("-f")
|
flags_with_completion+=("-f")
|
||||||
flags_completion+=("_filedir '@(json|yaml|yml)'")
|
flags_completion+=("__handle_filename_extension_flag json|yaml|yml")
|
||||||
flags+=("--help")
|
flags+=("--help")
|
||||||
flags+=("-h")
|
flags+=("-h")
|
||||||
flags+=("--patch=")
|
flags+=("--patch=")
|
||||||
@ -351,10 +358,10 @@ _kubectl_delete()
|
|||||||
flags+=("--cascade")
|
flags+=("--cascade")
|
||||||
flags+=("--filename=")
|
flags+=("--filename=")
|
||||||
flags_with_completion+=("--filename")
|
flags_with_completion+=("--filename")
|
||||||
flags_completion+=("_filedir '@(json|yaml|yml)'")
|
flags_completion+=("__handle_filename_extension_flag json|yaml|yml")
|
||||||
two_word_flags+=("-f")
|
two_word_flags+=("-f")
|
||||||
flags_with_completion+=("-f")
|
flags_with_completion+=("-f")
|
||||||
flags_completion+=("_filedir '@(json|yaml|yml)'")
|
flags_completion+=("__handle_filename_extension_flag json|yaml|yml")
|
||||||
flags+=("--grace-period=")
|
flags+=("--grace-period=")
|
||||||
flags+=("--help")
|
flags+=("--help")
|
||||||
flags+=("-h")
|
flags+=("-h")
|
||||||
@ -575,10 +582,10 @@ _kubectl_stop()
|
|||||||
flags+=("--all")
|
flags+=("--all")
|
||||||
flags+=("--filename=")
|
flags+=("--filename=")
|
||||||
flags_with_completion+=("--filename")
|
flags_with_completion+=("--filename")
|
||||||
flags_completion+=("_filedir '@(json|yaml|yml)'")
|
flags_completion+=("__handle_filename_extension_flag json|yaml|yml")
|
||||||
two_word_flags+=("-f")
|
two_word_flags+=("-f")
|
||||||
flags_with_completion+=("-f")
|
flags_with_completion+=("-f")
|
||||||
flags_completion+=("_filedir '@(json|yaml|yml)'")
|
flags_completion+=("__handle_filename_extension_flag json|yaml|yml")
|
||||||
flags+=("--grace-period=")
|
flags+=("--grace-period=")
|
||||||
flags+=("--help")
|
flags+=("--help")
|
||||||
flags+=("-h")
|
flags+=("-h")
|
||||||
@ -942,10 +949,9 @@ _kubectl()
|
|||||||
|
|
||||||
__start_kubectl()
|
__start_kubectl()
|
||||||
{
|
{
|
||||||
local cur prev words cword split
|
local cur prev words cword
|
||||||
_init_completion -s || return
|
_init_completion -s || return
|
||||||
|
|
||||||
local completions_func
|
|
||||||
local c=0
|
local c=0
|
||||||
local flags=()
|
local flags=()
|
||||||
local two_word_flags=()
|
local two_word_flags=()
|
||||||
|
Loading…
Reference in New Issue
Block a user