mirror of
https://github.com/ahmetb/kubectx.git
synced 2025-08-29 12:12:54 +00:00
allow disabling interactive mode with fzf (#82)
Introduce KUBECTX_IGNORE_FZF for both kubectx/kubens to force-disable attempt to enable interactive mode and lookup for fzf(1).
This commit is contained in:
parent
d931779c0c
commit
ccc077b6c5
@ -135,6 +135,9 @@ with fuzzy searching, you just need to [install
|
|||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
If you have `fzf` installed, but want to opt out of using this feature, set the environment variable `KUBECTX_IGNORE_FZF=1`.
|
||||||
|
|
||||||
|
|
||||||
-----
|
-----
|
||||||
|
|
||||||
### Customizing colors
|
### Customizing colors
|
||||||
|
2
kubectx
2
kubectx
@ -160,7 +160,7 @@ delete_context() {
|
|||||||
|
|
||||||
main() {
|
main() {
|
||||||
if [[ "$#" -eq 0 ]]; then
|
if [[ "$#" -eq 0 ]]; then
|
||||||
if [[ -t 1 && "$(type fzf &>/dev/null; echo $?)" -eq 0 ]]; then
|
if [[ -t 1 && -z "${KUBECTX_IGNORE_FZF:-}" && "$(type fzf &>/dev/null; echo $?)" -eq 0 ]]; then
|
||||||
choose_context_interactive
|
choose_context_interactive
|
||||||
else
|
else
|
||||||
list_contexts
|
list_contexts
|
||||||
|
2
kubens
2
kubens
@ -157,7 +157,7 @@ swap_namespace() {
|
|||||||
|
|
||||||
main() {
|
main() {
|
||||||
if [[ "$#" -eq 0 ]]; then
|
if [[ "$#" -eq 0 ]]; then
|
||||||
if [[ -t 1 && "$(type fzf &>/dev/null; echo $?)" -eq 0 ]]; then
|
if [[ -t 1 && -z ${KUBECTX_IGNORE_FZF:-} && "$(type fzf &>/dev/null; echo $?)" -eq 0 ]]; then
|
||||||
choose_namespace_interactive
|
choose_namespace_interactive
|
||||||
else
|
else
|
||||||
list_namespaces
|
list_namespaces
|
||||||
|
Loading…
Reference in New Issue
Block a user