Mercurial > vim-crosoft
annotate scripts/list_sln_configs.py @ 10:f444739dd8af
Improvements to YCM dynamic flags.
- Fallback to a "companion" item (e.g. header/source) or a nearby item
when no flags are found for an item.
- Finding a "companion" is also exposed as a standalone script.
- Ability to pass extra clang flags, including some from a special
file found in the .vimcrosoft directory.
- Add support for PCH and other forced-include files.
- Add options for short/long args, or forcing forward slashes.
- Debugging/troubleshooting options, including dumping a batch file and
response file to run clang directly, and the ability to auto-load a
solution's last known environment when running in command line.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Thu, 24 Sep 2020 23:02:16 -0700 |
parents | 5d2c0db51914 |
children |
rev | line source |
---|---|
0 | 1 import argparse |
2 import logging | |
3 from logutil import setup_logging | |
4 from vsutil import SolutionCache | |
5 | |
6 | |
7 logger = logging.getLogger(__name__) | |
8 | |
9 | |
10 def main(args=None): | |
11 parser = argparse.ArgumentParser() | |
12 parser.add_argument('solution', | |
13 help="The path to the Visual Studio solution file.") | |
14 parser.add_argument('-c', '--cache', | |
15 help="The path to the solution cache.") | |
16 parser.add_argument('-v', '--verbose', | |
17 action='store_true', | |
18 help="Show verbose information.") | |
19 args = parser.parse_args(args) | |
20 setup_logging(args.verbose) | |
21 | |
22 cache, _ = SolutionCache.load_or_rebuild(args.solution, args.cache) | |
23 sec = cache.slnobj.globalsection('SolutionConfigurationPlatforms') | |
24 for e in sec.entries: | |
25 config, platform = e.name.split('|') | |
26 if config != "Invalid" and platform != "Invalid": | |
27 print(e.name) | |
28 | |
29 | |
30 if __name__ == '__main__': | |
31 main() |