diff --git a/gamestonk_terminal/feature_flags.py b/gamestonk_terminal/feature_flags.py index 598d2e650a9..68573d346b8 100644 --- a/gamestonk_terminal/feature_flags.py +++ b/gamestonk_terminal/feature_flags.py @@ -42,3 +42,6 @@ ENABLE_QUICK_EXIT = strtobool(os.getenv("GTFF_ENABLE_QUICK_EXIT", "False")) # Open report as HTML, otherwise notebook OPEN_REPORT_AS_HTML = strtobool(os.getenv("GTFF_OPEN_REPORT_AS_HTML", "True")) + +# Enable auto print_help when exiting menus +ENABLE_EXIT_AUTO_HELP = strtobool(os.getenv("GTFF_ENABLE_EXIT_AUTO_HELP", "False")) diff --git a/gamestonk_terminal/parent_classes.py b/gamestonk_terminal/parent_classes.py index ac228496d77..f47f6a746f0 100644 --- a/gamestonk_terminal/parent_classes.py +++ b/gamestonk_terminal/parent_classes.py @@ -185,6 +185,9 @@ class BaseController(metaclass=ABCMeta): if len(self.queue) > 1: return self.queue[1:] + + if gtff.ENABLE_EXIT_AUTO_HELP: + return ["help"] return [] # Consume 1 element from the queue diff --git a/terminal.py b/terminal.py index ecb2e7c37da..4b12273f5a9 100644 --- a/terminal.py +++ b/terminal.py @@ -230,6 +230,9 @@ def terminal(jobs_cmds: List[str] = None): print_goodbye() break + if gtff.ENABLE_EXIT_AUTO_HELP and len(t_controller.queue) > 1: + t_controller.queue = t_controller.queue[1:] + # Consume 1 element from the queue an_input = t_controller.queue[0] t_controller.queue = t_controller.queue[1:]