From 379a07c4fd5e11571dcfcb1a2bd2aefc866555bd Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Tue, 11 Jun 2019 08:12:21 +0200 Subject: [PATCH] tesh: do return 0 when calling with --help I'm not sure why we had the previous construct, but everything seems to work nicely with this new form, that is both simpler and in line with all tutorials on argparse.py This fixes FG#20. --- ChangeLog | 6 +----- tools/tesh/tesh.py | 7 ++----- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6af1ea661c..3609374160 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,8 +1,3 @@ -This is SimGrid v3.22.4, a preview of v3.23 that is not released yet. - -It is distributed in the hope that it can be useful to you, but with -no waranty whatsoever. Released June 6. 2019. - ---------------------------------------------------------------------------- SimGrid (3.23) NOT RELEASED (Release Target: June 21. 2019, 15:54 UTC) @@ -48,6 +43,7 @@ Fixed bugs (FG=FramaGit; GH=GitHub): - FG#13: Installs unstripped file 'bin/graphicator' - FG#14: Installs the empty directory 'doc/simgrid/html' - FG#15: Setting -Denable_python=OFF doesn't disable the search for pybind11 + - FG#20: 'tesh --help' should return 0 - GH#133: Java: a process can run on a VM even if its host is off - GH#320: Stacktrace: Avoid the backtrace variant of Boost.Stacktrace? - GH#326: Valgrind-detected error for join() when energy plugin is activated diff --git a/tools/tesh/tesh.py b/tools/tesh/tesh.py index dc7b629bb3..aa1f65ecc6 100755 --- a/tools/tesh/tesh.py +++ b/tools/tesh/tesh.py @@ -469,7 +469,7 @@ if __name__ == '__main__': signal.signal(signal.SIGINT, signal_handler) signal.signal(signal.SIGTERM, signal_handler) - parser = argparse.ArgumentParser(description='tesh -- testing shell', add_help=True) + parser = argparse.ArgumentParser(description='tesh -- testing shell') group1 = parser.add_argument_group('Options') group1.add_argument('teshfile', nargs='?', help='Name of teshfile, stdin if omitted') group1.add_argument( @@ -489,10 +489,7 @@ if __name__ == '__main__': action='store_true', help='Keep the obtained output when it does not match the expected one') - try: - options = parser.parse_args() - except SystemExit: - tesh_exit(1) + options = parser.parse_args() if options.cd is not None: print("[Tesh/INFO] change directory to " + options.cd) -- 2.20.1