From 4af97a72e023fa1262f693499fd62251119c1f2a Mon Sep 17 00:00:00 2001 From: Rudyard Richter Date: Mon, 23 May 2022 14:00:50 -0500 Subject: [PATCH] Increase output width of all commands --- src/globus_cli/parsing/commands.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/globus_cli/parsing/commands.py b/src/globus_cli/parsing/commands.py index 07c2cc464..e13620801 100644 --- a/src/globus_cli/parsing/commands.py +++ b/src/globus_cli/parsing/commands.py @@ -8,6 +8,7 @@ import logging import sys +from shutil import get_terminal_size from typing import List import click @@ -51,6 +52,11 @@ def __init__(self, *args, **kwargs): kwargs["help"] = helptext.format( AUTOMATIC_ACTIVATION=self.AUTOMATIC_ACTIVATION_HELPTEXT ) + if "context_settings" not in kwargs: + kwargs["context_settings"] = {} + if "max_content_width" not in kwargs["context_settings"]: + term_size = get_terminal_size(fallback=(80, 20)) + kwargs["context_settings"]["max_content_width"] = int(0.8 * term_size.columns) super().__init__(*args, **kwargs) def invoke(self, ctx):