From c2d9c40162f6150df57a3160865bd8f3ae7baad3 Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Mon, 16 Oct 2023 17:06:29 +0300 Subject: [PATCH] .bashrc: Invert conditions `! has_completion $cmd &&` -> `has_completion $cmd ||` --- .bashrc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.bashrc b/.bashrc index fb36410..6f5f3a8 100644 --- a/.bashrc +++ b/.bashrc @@ -93,29 +93,29 @@ has_completion() { for cmd in builtin cgmem_nice command dbus-launch exec \ killall man nice nohup pidof pidOf KillAll pgrep pkill psg pswg \ run-hosts su sudo time whence whereis which xargs; do - ! has_completion $cmd && complete -o default -A command $cmd + has_completion $cmd || complete -o default -A command $cmd done for cmd in dig host mtr nslookup nc netcat nmap p ping ping6 \ ssh2 s2 socat telnet t tt \ tcptraceroute tcptraceroute6 tracert tracert6 traceroute traceroute6 \ whois wd wget wget-download wget-m wget-wrapper ww; do - ! has_completion $cmd && complete -A hostname $cmd + has_completion $cmd || complete -A hostname $cmd done for cmd in distribute ftp lftp r rsync \ s scp ssh smbclient tcpdump tshark wireshark; do - ! has_completion $cmd && complete -o default -A hostname $cmd + has_completion $cmd || complete -o default -A hostname $cmd done for cmd in bg fg jobs; do - ! has_completion $cmd && complete -A job $cmd + has_completion $cmd || complete -A job $cmd done complete -A job j wait for cmd in unset; do - ! has_completion $cmd && complete -A function -A variable $cmd + has_completion $cmd || complete -A function -A variable $cmd done if [ -d "$HOME"/.bash_completion.d -a \ @@ -128,7 +128,7 @@ fi delegate_completion() { local prog programs prog=$1 - ! has_completion $prog && return + has_completion $prog || return 0 shift programs="$@" eval "_${prog}_completion_loader() { -- 2.39.5