mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-08 04:32:37 +00:00
bash_completions: Generic function for --filename arguments
This generic function adds --filename= arguments to commands, and does the magic so they get bash completions to find json, yaml, or yml files.
This commit is contained in:
@@ -285,7 +285,11 @@ _kubectl_create()
|
||||
flags_completion=()
|
||||
|
||||
flags+=("--filename=")
|
||||
flags_with_completion+=("--filename")
|
||||
flags_completion+=("_filedir '@(json|yaml|yml)'")
|
||||
two_word_flags+=("-f")
|
||||
flags_with_completion+=("-f")
|
||||
flags_completion+=("_filedir '@(json|yaml|yml)'")
|
||||
flags+=("--help")
|
||||
flags+=("-h")
|
||||
|
||||
@@ -304,7 +308,11 @@ _kubectl_update()
|
||||
flags_completion=()
|
||||
|
||||
flags+=("--filename=")
|
||||
flags_with_completion+=("--filename")
|
||||
flags_completion+=("_filedir '@(json|yaml|yml)'")
|
||||
two_word_flags+=("-f")
|
||||
flags_with_completion+=("-f")
|
||||
flags_completion+=("_filedir '@(json|yaml|yml)'")
|
||||
flags+=("--help")
|
||||
flags+=("-h")
|
||||
flags+=("--patch=")
|
||||
@@ -325,7 +333,11 @@ _kubectl_delete()
|
||||
|
||||
flags+=("--all")
|
||||
flags+=("--filename=")
|
||||
flags_with_completion+=("--filename")
|
||||
flags_completion+=("_filedir '@(json|yaml|yml)'")
|
||||
two_word_flags+=("-f")
|
||||
flags_with_completion+=("-f")
|
||||
flags_completion+=("_filedir '@(json|yaml|yml)'")
|
||||
flags+=("--help")
|
||||
flags+=("-h")
|
||||
flags+=("--selector=")
|
||||
@@ -526,7 +538,11 @@ _kubectl_stop()
|
||||
|
||||
flags+=("--all")
|
||||
flags+=("--filename=")
|
||||
flags_with_completion+=("--filename")
|
||||
flags_completion+=("_filedir '@(json|yaml|yml)'")
|
||||
two_word_flags+=("-f")
|
||||
flags_with_completion+=("-f")
|
||||
flags_completion+=("_filedir '@(json|yaml|yml)'")
|
||||
flags+=("--help")
|
||||
flags+=("-h")
|
||||
flags+=("--selector=")
|
||||
|
Reference in New Issue
Block a user