From: Vincent Bernat Date: Thu, 10 Jul 2014 20:23:40 +0000 (+0200) Subject: lldpcli: reformat a bit bash completion to be more readable X-Git-Tag: 0.7.10~11 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=40df69956ad0161f9226d006c1b3c8fb2ec168f6;p=thirdparty%2Flldpd.git lldpcli: reformat a bit bash completion to be more readable --- diff --git a/debian/etc/bash_completion.d/lldpcli b/debian/etc/bash_completion.d/lldpcli index 8ee7878c..0779c5cc 100755 --- a/debian/etc/bash_completion.d/lldpcli +++ b/debian/etc/bash_completion.d/lldpcli @@ -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///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///g' -e 's/WORD//g' -e '/^$/d' | \ + tr -s " " | cut -d " " -f 1) COMPREPLY=($(compgen -W '${choices}' -- ${cur} )) return 0 }