[PATCH] D34594: [GSoC] Delete space after flags which has '=' prefix

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Jun 24 07:49:30 PDT 2017


ruiu added inline comments.


================
Comment at: clang/utils/bash-autocomplete.sh:4
 {
-  local cur prev words cword arg
+  local cur prev words cword arg=""
   _init_completion -n : || return
----------------
Do you need to set arg to ""? I thought that variables defined by `local` would automatically get an empty value.


================
Comment at: clang/utils/bash-autocomplete.sh:33-35
+    if [[ ${flags: -1} == '=' ]]; then
+      compopt -o nospace
+    fi
----------------
A shorthand notation of this which is used often in shell programming is

  [[ ${flag:-1} == '=' ]] && compopt -o nospace

Can you add a comment to describe why you need this? Something like "bash automatically appends a space after '=' by default. Disable it so that it works nicely for options in the form of -foo=bar."


https://reviews.llvm.org/D34594





More information about the llvm-commits mailing list