You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2020/11/28 19:46:38 UTC

[GitHub] [airflow] turbaszek commented on a change in pull request #12689: Use rich to render info and cheat-sheet command

turbaszek commented on a change in pull request #12689:
URL: https://github.com/apache/airflow/pull/12689#discussion_r532099056



##########
File path: airflow/cli/commands/cheat_sheet_command.py
##########
@@ -15,53 +15,44 @@
 # specific language governing permissions and limitations
 # under the License.
 
-import contextlib
-from typing import Iterable, List, Union
+from typing import Iterable, List, Optional, Union
 
-from termcolor import cprint
+from rich.console import Console
 
 from airflow.cli.cli_parser import ActionCommand, GroupCommand, airflow_commands
+from airflow.cli.commands.info_command import SimpleTable
 from airflow.utils.helpers import partition
-from airflow.utils.platform import is_terminal_support_colors
-from airflow.utils.process_utils import patch_environ
-
-ANSI_COLORS_DISABLED = "ANSI_COLORS_DISABLED"
-"""Environment variable disable using rich output. It is supported by termcolor library"""
 
 
 def cheat_sheet(args):
     """Display cheat-sheet."""
-    with contextlib.ExitStack() as exit_stack:
-        if not is_terminal_support_colors():
-            exit_stack.enter_context(patch_environ({ANSI_COLORS_DISABLED: "1"}))
-        cprint("List of all commands:".upper(), attrs=["bold", "underline"])
-        print()
-        display_commands_index()
+    display_commands_index()
 
 
 def display_commands_index():
     """Display list of all commands."""
 
-    def display_recursive(prefix: List[str], commands: Iterable[Union[GroupCommand, ActionCommand]]):
+    def display_recursive(
+        prefix: List[str], commands: Iterable[Union[GroupCommand, ActionCommand]],
+        help_msg: Optional[str] = None

Review comment:
       Yeah, thanks! I fixed it locally but did not adde this to commit 🤦 




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org