]> git.pld-linux.org Git - packages/bash-completion.git/blobdiff - bash-completion-ip_addresses.patch
- backslashes are important to shell; don't forget them if command is broken into...
[packages/bash-completion.git] / bash-completion-ip_addresses.patch
index 334710095102c2a9b4df9f0b5b29856677b0c3f4..720be3be2a05e68b08f6bb9891763c6eefbddbcd 100644 (file)
@@ -1,14 +1,18 @@
-diff -ruNp bash-completion-2.8.orig/bash_completion bash-completion-2.8/bash_completion
---- bash-completion-2.8.orig/bash_completion   2018-03-17 09:25:59.000000000 +0100
-+++ bash-completion-2.8/bash_completion        2018-06-24 00:00:18.077840392 +0200
-@@ -919,9 +919,7 @@ _ip_addresses()
- {
+--- bash-completion-2.11/bash_completion.orig  2021-03-06 22:21:09.007031994 +0100
++++ bash-completion-2.11/bash_completion       2021-03-06 22:24:28.382618551 +0100
+@@ -981,11 +981,10 @@ _ip_addresses()
+         *) n= ;;
+     esac
      local PATH=$PATH:/sbin
-     COMPREPLY+=( $( compgen -W \
--        "$( { LC_ALL=C ifconfig -a || ip addr show; } 2>/dev/null | command sed -ne \
--            's/.*addr:\([^[:space:]]*\).*/\1/p' -ne \
--            's|.*inet[[:space:]]\{1,\}\([^[:space:]/]*\).*|\1|p' )" \
-+        "$( ip -o addr show 2>/dev/null | command awk '{ gsub(/\/.*$/, "", $4); print $4 }' | sort )" \
-         -- "$cur" ) )
+-    local addrs=$({
+-        LC_ALL=C ifconfig -a || ip addr show
+-    } 2>/dev/null |
+-        command sed -e 's/[[:space:]]addr:/ /' -ne \
+-            "s|.*inet${n}[[:space:]]\{1,\}\([^[:space:]/]*\).*|\1|p")
++    local addrs=$(
++        LC_ALL=C ip -o addr show \
++    2>/dev/null | \
++      command awk '{ gsub(/\/.*$/, "", $4); print $4 }' | sort)
+     COMPREPLY+=($(compgen -W "$addrs" -- "${cur-}"))
  }
  
This page took 0.074436 seconds and 4 git commands to generate.