This revision was automatically updated to reflect the committed changes.
Closed by commit rL309113: [Bash-autocompletion] Show HelpText with possible
flags (authored by yamaguchi).
Changed prior to commit:
https://reviews.llvm.org/D35759?vs=107791&id=108267#toc
Repository:
rL LLVM
https://
teemperor accepted this revision.
teemperor added a comment.
LGTM.
Comment at: clang/utils/bash-autocomplete.sh:60
eval local path=${COMP_WORDS[0]}
- flags=$( "$path" --autocomplete="$arg" 2>/dev/null )
+ flags=$( "$path" --autocomplete="$arg" 2>/dev/null | sed -e 's/\t.*.
yamaguchi added a comment.
@ruiu
Yeah, we are planning to merge this to 5.0, so that clang Driver interface will
be compatible among further versions.
https://reviews.llvm.org/D35759
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://l
ruiu accepted this revision.
ruiu added a comment.
This revision is now accepted and ready to land.
LGTM
So, this patch changes the format of the --autocomplete option in an
incompatible way. The bash completion script that will be shipped with LLVM 5.0
will not be able to read the output of --
yamaguchi updated this revision to Diff 107791.
yamaguchi added a comment.
Update diff according to Rui's comment.
https://reviews.llvm.org/D35759
Files:
clang/lib/Driver/Driver.cpp
clang/test/Driver/autocomplete.c
clang/utils/bash-autocomplete.sh
llvm/lib/Option/OptTable.cpp
Index: ll
ruiu added inline comments.
Comment at: clang/utils/bash-autocomplete.sh:60
eval local path=${COMP_WORDS[0]}
- flags=$( "$path" --autocomplete="$arg" 2>/dev/null )
+ flags=$( "$path" --autocomplete="$arg" 2>/dev/null | sed -e 's/\t.*.\s*$//' )
# If clang is old that it do
yamaguchi updated this revision to Diff 107790.
yamaguchi added a comment.
Update diff.
Use llvm::join because we don't want to print two '\n's.
https://reviews.llvm.org/D35759
Files:
clang/lib/Driver/Driver.cpp
clang/test/Driver/autocomplete.c
clang/utils/bash-autocomplete.sh
llvm/lib/
ruiu added inline comments.
Comment at: clang/lib/Driver/Driver.cpp:1303
+ llvm::outs() << S << "\n";
+llvm::outs() << "\n";
return false;
You want to print out just one '\n' at end instead of two, no?
https://reviews.llvm.org/D35759
__
yamaguchi updated this revision to Diff 107781.
yamaguchi added a comment.
Update diff. Delete trailing whitespace so that -stdlib= autocompletion works
correctly.
https://reviews.llvm.org/D35759
Files:
clang/lib/Driver/Driver.cpp
clang/test/Driver/autocomplete.c
clang/utils/bash-autocom
yamaguchi updated this revision to Diff 107779.
yamaguchi added a comment.
Add newline after the end of the line.
https://reviews.llvm.org/D35759
Files:
clang/lib/Driver/Driver.cpp
clang/test/Driver/autocomplete.c
clang/utils/bash-autocomplete.sh
llvm/lib/Option/OptTable.cpp
Index: llv
yamaguchi added inline comments.
Comment at: llvm/lib/Option/OptTable.cpp:240
if (StringRef(S).startswith(Cur))
-Ret.push_back(S);
+Ret.push_back(S + "\t" + std::string(StringRef(In.HelpText)));
}
ruiu wrote:
> I believe
>
> Ret.pus
yamaguchi updated this revision to Diff 107778.
yamaguchi added a comment.
Fixed test and update diff according to Rui's comment.
https://reviews.llvm.org/D35759
Files:
clang/lib/Driver/Driver.cpp
clang/test/Driver/autocomplete.c
clang/utils/bash-autocomplete.sh
llvm/lib/Option/OptTable
ruiu added inline comments.
Comment at: clang/lib/Driver/Driver.cpp:1302
-llvm::outs() << llvm::join(SuggestedCompletions, " ") << '\n';
+llvm::outs() << llvm::join(SuggestedCompletions, "\n") << '\n';
return false;
Now that the separator and the t
yamaguchi created this revision.
Herald added a subscriber: hiraditya.
`clang --autocomplete=-std` will show
-std: Language standard to compile for
-std= Language standard to compile for
-stdlib=C++ standard library to use
by this change.
However, showing HelpText with complet
14 matches
Mail list logo