Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
tesh: do return 0 when calling with --help
authorMartin Quinson <martin.quinson@ens-rennes.fr>
Tue, 11 Jun 2019 06:12:21 +0000 (08:12 +0200)
committerMartin Quinson <martin.quinson@ens-rennes.fr>
Tue, 11 Jun 2019 06:15:42 +0000 (08:15 +0200)
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
tools/tesh/tesh.py

index 6af1ea6..3609374 100644 (file)
--- 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)
 ----------------------------------------------------------------------------
 
 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#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
  - 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
index dc7b629..aa1f65e 100755 (executable)
@@ -469,7 +469,7 @@ if __name__ == '__main__':
     signal.signal(signal.SIGINT, signal_handler)
     signal.signal(signal.SIGTERM, signal_handler)
 
     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(
     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')
 
         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)
 
     if options.cd is not None:
         print("[Tesh/INFO] change directory to " + options.cd)