@@ -28,11 +28,19 @@ def main():
2828 parser .add_argument ('--port' , type = int , default = 8000 , help = 'Port number to run the server on' )
2929 parser .add_argument ('--doxygen' , type = str , default = 'doxygen' , help = 'Path to doxygen executable' )
3030 parser .add_argument ('--doxyfile' , type = str , default = 'Doxyfile' , help = 'Path to Doxyfile to use' )
31+ parser .add_argument ('--debug' , action = "store_true" , help = 'Display warnings' )
32+ parser .add_argument ('--version' , action = "store_true" , help = 'Display doxygen version used' )
3133 args = parser .parse_args ()
3234
3335 PORT = args .port
3436 DOXYGEN = args .doxygen
3537 DOXYFILE = args .doxyfile
38+ DEBUG = args .debug
39+ VERSION = args .version
40+
41+ if VERSION :
42+ VERSION_STR = subprocess .run ([DOXYGEN , '-v' ], \
43+ capture_output = True , text = True , encoding = "utf-8" )
3644
3745 class RequestHandler (http .server .SimpleHTTPRequestHandler ):
3846 def do_POST (self ):
@@ -50,7 +58,14 @@ def do_POST(self):
5058 self .send_response (200 )
5159 self .send_header ('Content-type' , 'text/html' )
5260 self .end_headers ()
61+ if VERSION :
62+ self .wfile .write (VERSION_STR .stdout .encode ())
63+ self .wfile .write ("<hr>" .encode ())
5364 self .wfile .write (result .stdout .encode ())
65+ if DEBUG :
66+ self .wfile .write ("<hr>\n <pre>" .encode ())
67+ self .wfile .write (result .stderr .replace ('&' ,'&' ).replace ("'" ,"'" ).replace ('<' ,'<' ).replace ('>' ,'>' ).encode ())
68+ self .wfile .write ("</pre>" .encode ())
5469
5570 httpd = socketserver .TCPServer (("" , PORT ), RequestHandler )
5671
0 commit comments