summaryrefslogtreecommitdiffstats
path: root/clang/utils/bash-autocomplete.sh
Commit message (Collapse)AuthorAgeFilesLines
* [bash-completion] Fix tab separation on macOSBen Langmuir2018-05-241-1/+2
| | | | | | | | We have a regex that needs to match a tab character in the command output, but on macOS sed doesn't support '\t', causing it to split on the 't' character instead. Fix by having bash expand the \t first. llvm-svn: 333202
* Fix typos in clangAlexander Kornienko2018-04-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Found via codespell -q 3 -I ../clang-whitelist.txt Where whitelist consists of: archtype cas classs checkk compres definit frome iff inteval ith lod methode nd optin ot pres statics te thru Patch by luzpaz! (This is a subset of D44188 that applies cleanly with a few files that have dubious fixes reverted.) Differential revision: https://reviews.llvm.org/D44188 llvm-svn: 329399
* [Bash-autocompletion] Pass all flags in shell command-line to ClangYuka Takahashi2018-03-051-30/+11
| | | | | | | | | | | | | | | | | | | | Previously, we passed "#" to --autocomplete to indicate to enable cc1 flags. For example, when -cc1 or -Xclang was passed to bash, bash executed `clang --autocomplete=#-<flag they want to complete>`. However, this was not a good implementation because it depends -Xclang and -cc1 parsing to shell. So I changed this to pass all flags shell has, so that Clang can handle them internally. I had to change many testcases because API spec changed quite a lot. Reviewers: teemperor, v.g.vassilev Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D39342 llvm-svn: 326684
* [Bash-autocompletion] Show HelpText with possible flagsYuka Takahashi2017-07-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | Summary: `clang --autocomplete=-std` will show ``` -std: Language standard to compile for -std= Language standard to compile for -stdlib= C++ standard library to use ``` after this change. However, showing HelpText with completion in bash seems super tricky, so this feature will be used in other shells (fish, zsh...). Reviewers: v.g.vassilev, teemperor, ruiu Subscribers: cfe-commits, hiraditya Differential Revision: https://reviews.llvm.org/D35759 llvm-svn: 309113
* [Bash-completion] Fixed a bug that file doesn't autocompleted after =Yuka Takahashi2017-07-261-3/+7
| | | | | | | | | | Summary: File path wasn't autocompleted after `-fmodule-cache-path=[tab]`, so fixed this bug by checking if $flags contains only a newline or not. Differential Revision: https://reviews.llvm.org/D35763 llvm-svn: 309112
* [Bash-autocompletion] Fixed a bug on bashYuka Takahashi2017-07-151-4/+7
| | | | | | | | Summary: Maybe I mismerged when merging previous commits by hand. Differential Revision: https://reviews.llvm.org/D35448 llvm-svn: 308091
* [Bash-autocompletion] Auto complete cc1 options if -cc1 is specifiedYuka Takahashi2017-07-081-6/+10
| | | | | | | | | | | | | | Summary: We don't want to autocomplete flags whose Flags class has `NoDriverOption` when argv[1] is not `-cc1`. Another idea for this implementation is to make --autocomplete a cc1 option and handle it in clang Frontend, by porting --autocomplete handler from Driver to Frontend, so that we can handle Driver options and CC1 options in unified manner. Differential Revision: https://reviews.llvm.org/D34770 llvm-svn: 307479
* [Bash-autocompletion] Fix a bug that -foo=bar doesn't handled properlyYuka Takahashi2017-07-081-0/+6
| | | | | | | | Summary: Fixed a bug that -foo=bar wasn't handled properly on old version of bash. Differential Revision: https://reviews.llvm.org/D34927 llvm-svn: 307478
* [Bash-autocompletion] Add support for older bash version.Yuka Takahashi2017-07-011-7/+25
| | | | | | | | | | | | | | Summary: OS X seems to use older bash version which doesn't suport _init_completion and compopt, so add support for this. Reviewers: ruiu, v.g.vassilev, teemperor Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D34924 llvm-svn: 306962
* [Bash-completion] Fixed a bug that ~ doesn't expanded to $HOMEYuka Takahashi2017-07-011-1/+3
| | | | | | | | Summary: `~/build/bin/clang -f[tab]` was executed without ~ expanded to $HOME, so changed this by expanding ~ to path using eval. Differential Revision: https://reviews.llvm.org/D34925 llvm-svn: 306957
* [Bash-autocompletion] Invoke clang where user calledYuka Takahashi2017-06-281-1/+1
| | | | | | | | | Summary: When user build clang and used completion Eg. `build/bin/clang -fno[tab]`, we want to invoke `build/bin/clang --autocomplete=-fno`, rather than `clang --autocomplete=-fno`. Differential Revision: https://reviews.llvm.org/D34761 llvm-svn: 306559
* [Bash-autocompletion] Check clang version in BashYuka Takahashi2017-06-281-2/+9
| | | | | | | | | | | | | | Summary: Add check if user's clang version supports --autocomplete or not. If not, we just autocomplete files. Reviewers: ruiu, v.g.vassilev, teemperor Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D34607 llvm-svn: 306555
* [bash-autocompletion] Delete space after flags which has '=' prefixYuka Takahashi2017-06-261-4/+5
| | | | | | | | | | Summary: This is patch for bash completion for clang project. We don't need space when completing options like "-stdlib=". Differential Revision: https://reviews.llvm.org/D34594 llvm-svn: 306258
* [GSoC] Flag value completion for clangYuka Takahashi2017-06-201-3/+27
| | | | | | | | | | | | This is patch for GSoC project, bash-completion for clang. To use this on bash, please run `source clang/utils/bash-autocomplete.sh`. bash-autocomplete.sh is code for bash-completion. In this patch, Options.td was mainly changed in order to add value class in Options.inc. llvm-svn: 305805
* Remove trailing whitespaceYuka Takahashi2017-05-231-1/+1
| | | | llvm-svn: 303672
* [GSoC] Shell autocompletion for clangYuka Takahashi2017-05-231-0/+14
Summary: This is a first patch for GSoC project, bash-completion for clang. To use this on bash, please run `source clang/utils/bash-autocomplete.sh`. bash-autocomplete.sh is code for bash-completion. Simple flag completion and path completion is available in this patch. Reviewers: teemperor, v.g.vassilev, ruiu, Bigcheese, efriedma Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D33237 llvm-svn: 303670
OpenPOWER on IntegriCloud