Last active
October 27, 2017 13:43
-
-
Save kbenzie/70689deba8575c6353ac to your computer and use it in GitHub Desktop.
Treat doxygen warnings as errors and concisely display warnings/errors.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
from __future__ import print_function | |
def main(): | |
from argparse import ArgumentParser | |
from platform import system | |
from subprocess import Popen, PIPE | |
from sys import stderr | |
parser = ArgumentParser() | |
parser.add_argument('args', nargs='*', help='arguments passed to doxygen') | |
parser.add_argument( | |
'--exe', | |
default='doxygen.exe' if system() == 'Windows' else 'doxygen', | |
help='path to doxygen executable, default: %(default)s') | |
args = parser.parse_args() | |
process = Popen([args.exe] + args.args, stdout=PIPE, stderr=PIPE) | |
errors = process.stderr.read().strip() | |
if len(errors) != 0: | |
print(errors, file=stderr) | |
exit(2) | |
try: | |
main() | |
except KeyboardInterrupt: | |
pass |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment