From b7819965b55717087603f780eee88fd9e389a3a8 Mon Sep 17 00:00:00 2001 From: Leonhard Reichenbach Date: Wed, 2 Aug 2023 10:18:15 +0200 Subject: [PATCH] k4run: add help manually --- k4FWCore/scripts/k4run | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/k4FWCore/scripts/k4run b/k4FWCore/scripts/k4run index f0a8f48f..31d75e1c 100755 --- a/k4FWCore/scripts/k4run +++ b/k4FWCore/scripts/k4run @@ -96,7 +96,7 @@ if __name__ == "__main__": logger.addHandler(handler) global parser - parser = argparse.ArgumentParser(description="Run job in the Key4HEP framework") + parser = argparse.ArgumentParser(description="Run job in the Key4HEP framework", add_help=False) parser.add_argument("config_files", type=open, action=LoadFromFile, nargs="*", help="Gaudi config (python) files describing the job") parser.add_argument("--dry-run", action="store_true", @@ -140,6 +140,9 @@ if __name__ == "__main__": print(" %s (from %s)" % (item, cfgDb[item]["lib"])) sys.exit() + # add help manually here, if it is added earlier the parser exits after the first parse_arguments call + parser.add_argument("-h", "--help", action="help", default=argparse.SUPPRESS, help="show this help message and exit") + opts = parser.parse_args() # print a doc line showing the configured algorithms