From 73656f181facb9445dffd0b578f27f9ab9bb7ee7 Mon Sep 17 00:00:00 2001 From: mcflugen Date: Tue, 21 Jun 2022 09:42:47 -0600 Subject: [PATCH] return value from click.Command.main if not in standalone mode --- src/rich_click/rich_command.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/rich_click/rich_command.py b/src/rich_click/rich_command.py index 664777d4..a9e86cce 100644 --- a/src/rich_click/rich_command.py +++ b/src/rich_click/rich_command.py @@ -16,7 +16,9 @@ class RichCommand(click.Command): def main(self, *args, standalone_mode: bool = True, **kwargs): try: - return super().main(*args, standalone_mode=False, **kwargs) + rv = super().main(*args, standalone_mode=False, **kwargs) + if not standalone_mode: + return rv except click.ClickException as e: if not standalone_mode: raise