From 90b41aa672197c88edcd6a56937c0a43323cfe2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Kr=C3=BCger?= Date: Tue, 22 Jul 2014 01:12:27 +0200 Subject: [PATCH] htmlreport: if no arguments are passed, print --help output; when done generating the report, print where index.html is (take report_dir into account). --- htmlreport/cppcheck-htmlreport | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/htmlreport/cppcheck-htmlreport b/htmlreport/cppcheck-htmlreport index 832f90527..1ff69fb2d 100755 --- a/htmlreport/cppcheck-htmlreport +++ b/htmlreport/cppcheck-htmlreport @@ -262,6 +262,13 @@ if __name__ == '__main__': # Parse options and make sure that we have an output directory set. options, args = parser.parse_args() + + try: + sys.argv[1] + except IndexError: # no arguments give, print --help + parser.print_help() + quit() + if not options.report_dir: parser.error('No report directory set.') @@ -415,3 +422,5 @@ if __name__ == '__main__': with io.open(os.path.join(options.report_dir, 'style.css'), 'w') as css_file: css_file.write(STYLE_FILE) + + print("\nOpen '" + options.report_dir + "/index.html' to see the results.")