diff options
author | Peter Foley <pefoley2@pefoley.com> | 2014-09-24 13:21:50 -0400 |
---|---|---|
committer | Samuel Mehrbrodt <s.mehrbrodt@gmail.com> | 2014-09-24 18:04:16 +0000 |
commit | 1a6737d3a008f75f2a5e08bae2732716440e37b5 (patch) | |
tree | a775a5e610ff230aa3271dc2f90837986d250505 /bin | |
parent | 0e55cc95dfe21e4d4800592ce8029ff039ea4307 (diff) |
Make gbuild-to-ide bail out before parsing if ide type is invalid
Also fix the vim modeline to maintain consistant formatting
Change-Id: Ia42ec2a69f9c3037a6390ca4f5c4198031b7aa64
Reviewed-on: https://gerrit.libreoffice.org/11632
Reviewed-by: Samuel Mehrbrodt <s.mehrbrodt@gmail.com>
Tested-by: Samuel Mehrbrodt <s.mehrbrodt@gmail.com>
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/gbuild-to-ide | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/bin/gbuild-to-ide b/bin/gbuild-to-ide index 2e8bc3076ddd..919f787c5488 100755 --- a/bin/gbuild-to-ide +++ b/bin/gbuild-to-ide @@ -872,27 +872,26 @@ if __name__ == '__main__': help='the input file, not normally used, for debugging this script') args = parser.parse_args() paths = {} + generators = { + 'kdevelop': KdevelopIntegrationGenerator, + 'xcode': XcodeIntegrationGenerator, + 'vs2012': VisualStudioIntegrationGenerator, + 'vim': VimIntegrationGenerator, + 'debug': DebugIntegrationGenerator} + + if args.ide not in generators.keys(): + parser.print_help() + sys.exit(1) + if args.input: gbuildparser = GbuildParser().parse(open(args.input, 'r')) else: gbuildparser = GbuildParser().parse(sys.stdin) - if args.ide == 'kdevelop': - KdevelopIntegrationGenerator(gbuildparser).emit() - elif args.ide == 'xcode': - XcodeIntegrationGenerator(gbuildparser).emit() - elif args.ide == 'vs2012': - VisualStudioIntegrationGenerator(gbuildparser).emit() - elif args.ide == 'vim': - VimIntegrationGenerator(gbuildparser).emit() - elif args.ide == 'debug': - DebugIntegrationGenerator(gbuildparser).emit() - else: - parser.print_help() - sys.exit(1) + generators[args.ide](gbuildparser).emit() # Local Variables: # indent-tabs-mode: nil # End: # -# vim: set noet sw=4 ts=4: +# vim: set et sw=4 ts=4: |