[PATCH] D34594: [GSoC] Delete space after flags which has '=' prefix
Hal Finkel via llvm-commits
llvm-commits at lists.llvm.org
Sat Jun 24 13:02:52 PDT 2017
Hi,
Thanks for working on this. A couple of procedural notes:
1. This is a patch for Clang, not LLVM itself, and cfe-commits, not
llvm-commits, is the appropriate list cc on the reviews.
2. Please don't use the tag [GSoC] on patches. The [] tags should be
topical. There have been multiple GSoC projects over multiple years. For
example, [bash-autocomplete] would be good. I expect conversations
tagged with [GSoC] to be about the LLVM community's participation in
GSoC or GSoC project proposals.
-Hal
On 06/24/2017 08:55 AM, Yuka Takahashi via Phabricator via llvm-commits
wrote:
> yamaguchi created this revision.
>
> This is patch for bash completion for clang project.
> We don't need `=` when completing options like "-stdlib=".
>
>
> https://reviews.llvm.org/D34594
>
> Files:
> clang/utils/bash-autocomplete.sh
>
>
> Index: clang/utils/bash-autocomplete.sh
> ===================================================================
> --- clang/utils/bash-autocomplete.sh
> +++ clang/utils/bash-autocomplete.sh
> @@ -1,7 +1,7 @@
> # Please add "source /path/to/bash-autocomplete.sh" to your .bashrc to use this.
> _clang()
> {
> - local cur prev words cword arg
> + local cur prev words cword arg=""
> _init_completion -n : || return
>
> # bash always separates '=' as a token even if there's no space before/after '='.
> @@ -22,16 +22,17 @@
> elif [[ "$w2" == -* && "$w1" == '=' ]]; then
> # -foo=bar<tab>
> arg="$w2=,$cur"
> - else
> - _filedir
> fi
>
> local flags=$( clang --autocomplete="$arg" )
> - if [[ "$cur" == "=" ]]; then
> + if [[ "$cur" == '=' ]]; then
> COMPREPLY=( $( compgen -W "$flags" -- "") )
> - elif [[ "$flags" == "" ]]; then
> + elif [[ "$flags" == "" || "$arg" == "" ]]; then
> _filedir
> else
> + if [[ ${flags: -1} == '=' ]]; then
> + compopt -o nospace
> + fi
> COMPREPLY=( $( compgen -W "$flags" -- "$cur" ) )
> fi
> }
>
>
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
--
Hal Finkel
Lead, Compiler Technology and Programming Languages
Leadership Computing Facility
Argonne National Laboratory
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170624/18a51cf3/attachment.html>
More information about the llvm-commits
mailing list