Fix bash completion in case of user grep color aliases 39/40839/2
authorLukasz Pawelczyk <l.pawelczyk@samsung.com>
Tue, 9 Jun 2015 13:18:29 +0000 (15:18 +0200)
committerDariusz Michaluk <d.michaluk@samsung.com>
Tue, 9 Jun 2015 13:44:56 +0000 (06:44 -0700)
[Bug]           Mitigate user grep aliases that use colors
[Cause]         N/A
[Solution]      Add --color=never to grep
[Verification]  Checked that bash completion works

Change-Id: Ifffaf2e931f1cd573c6629a1932aca28b924509a

cli/support/vasum-cli-completion.sh.in

index 79a5dad..18dda54 100755 (executable)
@@ -6,7 +6,7 @@ __@PROJECT_NAME@_cli() {
 
     COMPREPLY=()
     if [ "$COMP_CWORD" == "1" ]; then
-        COMPREPLY=($(compgen -W "$(@CLI_CODENAME@ | grep -e '^\S' | tail -n +3 | cut -f1 -d' ')" -- $cur))
+        COMPREPLY=($(compgen -W "$(@CLI_CODENAME@ | grep --color=never -e '^\S' | tail -n +3 | cut -f1 -d' ')" -- $cur))
     elif [ "$COMP_CWORD" == "2" ]; then
         COMPREPLY=($(compgen -W "-h" -- $cur))
     fi