perf: remove unnecessary subshells in command -v checks

Replace 'if (command -v x &>/dev/null); then' with
'if command -v x &>/dev/null; then' across completion.d, rc.d and
profile.d. Parentheses forced a subshell fork for every 'if' check,
which is unnecessary overhead since command -v runs fine in the
current shell.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
Xavier LogeraisandCopilot committed 2026-09-28 18:17:13 +02:00
1 parent 6d791dbe29
commit 158c3f99f0
30 files changed
+36 -36

No files matched your search

+1 -1
View File
@@ -1,3 +1,3 @@
if (command -v aws && command -v aws_completer) &>/dev/null; then
if command -v aws &>/dev/null && command -v aws_completer &>/dev/null; then
complete -C aws_completer aws
fi
+1 -1
View File
@@ -1,3 +1,3 @@
if (command -v chezmoi &>/dev/null); then
if command -v chezmoi &>/dev/null; then
source <(chezmoi completion bash)
fi
+1 -1
View File
@@ -1,3 +1,3 @@
if (command -v flux &>/dev/null); then
if command -v flux &>/dev/null; then
source <(flux completion bash)
fi
+1 -1
View File
@@ -1,3 +1,3 @@
if (command -v glab &>/dev/null); then
if command -v glab &>/dev/null; then
source <(glab completion)
fi
+1 -1
View File
@@ -1,4 +1,4 @@
if (command -v helm &> /dev/null)
if command -v helm &> /dev/null
then
source <( helm completion bash )
fi
+1 -1
View File
@@ -1,3 +1,3 @@
if (command -v k3d &>/dev/null); then
if command -v k3d &>/dev/null; then
source <(k3d completion bash)
fi
+1 -1
View File
@@ -1,3 +1,3 @@
if (command -v kind &>/dev/null); then
if command -v kind &>/dev/null; then
source <(kind completion bash)
fi
+1 -1
View File
@@ -1,4 +1,4 @@
if (command -v kubectl &> /dev/null)
if command -v kubectl &> /dev/null
then
source <(kubectl completion bash)
fi
+1 -1
View File
@@ -1,3 +1,3 @@
if (command -v minikube &>/dev/null); then
if command -v minikube &>/dev/null; then
source <(minikube completion bash)
fi
+1 -1
View File
@@ -1,3 +1,3 @@
if (command -v mise &>/dev/null); then
if command -v mise &>/dev/null; then
source <(mise completion bash)
fi
+1 -1
View File
@@ -1,3 +1,3 @@
if (command -v podman &>/dev/null); then
if command -v podman &>/dev/null; then
source <(podman completion bash)
fi
+1 -1
View File
@@ -1,4 +1,4 @@
if ( command -v poetry &> /dev/null )
if command -v poetry &> /dev/null
then
source <(poetry completions bash)
fi
+1 -1
View File
@@ -1,4 +1,4 @@
if (command -v stern &> /dev/null)
if command -v stern &> /dev/null
then
source <(stern --completion bash)
fi
+1 -1
View File
@@ -1,7 +1,7 @@
#
# Completion for taskwarrior
#
if (command -v task &> /dev/null)
if command -v task &> /dev/null
then
complete -o nospace -F _task t
fi
+1 -1
View File
@@ -1,3 +1,3 @@
if (command -v tea &>/dev/null); then
if command -v tea &>/dev/null; then
source <(tea completion bash)
fi