mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-06 11:42:14 +00:00
annotate required flags for bash_completions
some commands require that certain flags be set in order to function. Annotate those flags so the bash completions will suggest to the user that they be set.
This commit is contained in:
@@ -304,6 +304,8 @@ _kubectl_create()
|
||||
flags+=("-h")
|
||||
|
||||
must_have_one_flag=()
|
||||
must_have_one_flag+=("--filename=")
|
||||
must_have_one_flag+=("-f")
|
||||
must_have_one_noun=()
|
||||
}
|
||||
|
||||
@@ -328,6 +330,9 @@ _kubectl_update()
|
||||
flags+=("--patch=")
|
||||
|
||||
must_have_one_flag=()
|
||||
must_have_one_flag+=("--filename=")
|
||||
must_have_one_flag+=("-f")
|
||||
must_have_one_flag+=("--patch=")
|
||||
must_have_one_noun=()
|
||||
}
|
||||
|
||||
@@ -433,6 +438,7 @@ _kubectl_resize()
|
||||
flags+=("--resource-version=")
|
||||
|
||||
must_have_one_flag=()
|
||||
must_have_one_flag+=("--replicas=")
|
||||
must_have_one_noun=()
|
||||
}
|
||||
|
||||
@@ -458,6 +464,10 @@ _kubectl_exec()
|
||||
flags+=("-t")
|
||||
|
||||
must_have_one_flag=()
|
||||
must_have_one_flag+=("--container=")
|
||||
must_have_one_flag+=("-c")
|
||||
must_have_one_flag+=("--pod=")
|
||||
must_have_one_flag+=("-p")
|
||||
must_have_one_noun=()
|
||||
}
|
||||
|
||||
@@ -477,6 +487,8 @@ _kubectl_port-forward()
|
||||
two_word_flags+=("-p")
|
||||
|
||||
must_have_one_flag=()
|
||||
must_have_one_flag+=("--pod=")
|
||||
must_have_one_flag+=("-p")
|
||||
must_have_one_noun=()
|
||||
}
|
||||
|
||||
@@ -533,6 +545,7 @@ _kubectl_run-container()
|
||||
two_word_flags+=("-t")
|
||||
|
||||
must_have_one_flag=()
|
||||
must_have_one_flag+=("--image=")
|
||||
must_have_one_noun=()
|
||||
}
|
||||
|
||||
@@ -595,6 +608,7 @@ _kubectl_expose()
|
||||
two_word_flags+=("-t")
|
||||
|
||||
must_have_one_flag=()
|
||||
must_have_one_flag+=("--port=")
|
||||
must_have_one_noun=()
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user