From 0cb1b37652e9c7d2dc1ded0668257baf0239b4a8 Mon Sep 17 00:00:00 2001 From: hjoaquim Date: Wed, 8 May 2024 23:08:12 +0100 Subject: [PATCH] keep command on the obbject so it can be shown on the results --- cli/openbb_cli/argparse_translator/obbject_registry.py | 1 + cli/openbb_cli/controllers/base_platform_controller.py | 3 +++ 2 files changed, 4 insertions(+) diff --git a/cli/openbb_cli/argparse_translator/obbject_registry.py b/cli/openbb_cli/argparse_translator/obbject_registry.py index 848140062a7..1c4cbf80dd9 100644 --- a/cli/openbb_cli/argparse_translator/obbject_registry.py +++ b/cli/openbb_cli/argparse_translator/obbject_registry.py @@ -79,6 +79,7 @@ class Registry: "provider": obbject.provider, "standard params": _handle_standard_params(obbject), "data": _handle_data_repr(obbject), + "command": obbject.extra.get("command", ""), } return obbjects diff --git a/cli/openbb_cli/controllers/base_platform_controller.py b/cli/openbb_cli/controllers/base_platform_controller.py index f12b6cad68f..f4abc38057f 100644 --- a/cli/openbb_cli/controllers/base_platform_controller.py +++ b/cli/openbb_cli/controllers/base_platform_controller.py @@ -162,6 +162,9 @@ class PlatformController(BaseController): if max_obbjects_exceeded: session.obbject_registry.remove() + # use the obbject to store the command so we can display it later on results + obbject.extra["command"] = f"{title} {' '.join(other_args)}" + session.obbject_registry.register(obbject) # we need to force to re-link so that the new obbject # is immediately available for data processing commands