From f2d732e40c49b19bf1a3f0c968d27d766512d890 Mon Sep 17 00:00:00 2001
From: Michael <m.langguth@fz-juelich.de>
Date: Tue, 19 Jul 2022 15:23:30 +0200
Subject: [PATCH] Correct handling of 'help'-request in runscript generator.

---
 video_prediction_tools/env_setup/generate_runscript.py         | 3 ++-
 .../utils/runscript_generator/config_utils.py                  | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/video_prediction_tools/env_setup/generate_runscript.py b/video_prediction_tools/env_setup/generate_runscript.py
index 0ce5df23..a342ccbb 100755
--- a/video_prediction_tools/env_setup/generate_runscript.py
+++ b/video_prediction_tools/env_setup/generate_runscript.py
@@ -85,7 +85,8 @@ def main():
     def check_target_runscript(runscript_name, silent=False):
         if not runscript_name in known_wrkflw_steps:
             if not silent:
-                print("Invalid workflow step '{0}' passed!".format(runscript_name))
+                if runscript_name != "help":
+                    print("Invalid workflow step '{0}' passed!".format(runscript_name))
                 print("Known workflow steps:")
                 for step in known_wrkflw_steps:
                     print("* {0}".format(step))
diff --git a/video_prediction_tools/utils/runscript_generator/config_utils.py b/video_prediction_tools/utils/runscript_generator/config_utils.py
index b385b838..0624ceed 100755
--- a/video_prediction_tools/utils/runscript_generator/config_utils.py
+++ b/video_prediction_tools/utils/runscript_generator/config_utils.py
@@ -303,7 +303,8 @@ class Config_runscript_base:
             if check_input(input_req):
                 break
             else:
-                if input_req.replace(prefix2arg, "") == "help":
+                check_input_req = input_req.replace(prefix2arg, "") if prefix2arg else input_req
+                if check_input_req == "help":
                     pass
                 else:
                     attempt += 1
-- 
GitLab