]> git.ipfire.org Git - thirdparty/lldpd.git/commitdiff
lldpcli: reformat a bit bash completion to be more readable
authorVincent Bernat <vincent@bernat.im>
Thu, 10 Jul 2014 20:23:40 +0000 (22:23 +0200)
committerVincent Bernat <vincent@bernat.im>
Thu, 10 Jul 2014 20:23:40 +0000 (22:23 +0200)
debian/etc/bash_completion.d/lldpcli

index 8ee7878cba9feb6faa4bac86d5758ac090e36f4d..0779c5cc6a1639827098a28de21c07f0969e8ee2 100755 (executable)
@@ -1,3 +1,4 @@
+# -*- sh -*-
 _lldpcli()
 {
     COMPREPLY=()
@@ -9,7 +10,10 @@ _lldpcli()
         unset cmd[COMP_CWORD]
     fi
 
- local choices=$(sudo ${cmd[0]} help ${cmd[@]:1} 2>&1 | tail -n +3 | sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g" | sed -e 's/^[ \t]*//g' -e 's/<CR>//g' -e 's/WORD//g' -e '/^$/d' | tr -s " " | cut -d " " -f 1)
+    local choices=$(sudo ${cmd[0]} help ${cmd[@]:1} 2>&1 | \
+        tail -n +3 | sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g" | \
+        sed -e 's/^[ \t]*//g' -e 's/<CR>//g' -e 's/WORD//g' -e '/^$/d' | \
+        tr -s " " | cut -d " " -f 1)
     COMPREPLY=($(compgen -W '${choices}' -- ${cur} ))
     return 0
 }