aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorgi Valkov <georgi.t.valkov@gmail.com>2011-08-23 16:42:51 +0300
committerGeorgi Valkov <georgi.t.valkov@gmail.com>2011-08-23 16:42:51 +0300
commit51c8e53ffe62a126a89a5a5ebbaf360a639c9352 (patch)
tree878735c0419078bdb321c9b779700d1ce43b53e6
parent4f9f96f646cb8df69f77b04bf6af9f4a50aa0b47 (diff)
Set help formatter width to terminal width (prevents wrapping)
-rwxr-xr-xyoutube-dl9
1 files changed, 8 insertions, 1 deletions
diff --git a/youtube-dl b/youtube-dl
index d093e2558..ac27afdc3 100755
--- a/youtube-dl
+++ b/youtube-dl
@@ -2744,7 +2744,14 @@ def parseOpts():
return "".join(opts)
- fmt = optparse.IndentedHelpFormatter()
+ max_width = 80
+ max_help_position = 80
+
+ # No need to wrap help messages if we're on a wide console
+ columns = os.environ.get('COLUMNS', None)
+ if columns: max_width = columns
+
+ fmt = optparse.IndentedHelpFormatter(width=max_width, max_help_position=max_help_position)
fmt.format_option_strings = _format_option_string
kw = {