projects
/
youtube-dl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4f9f96f
)
Set help formatter width to terminal width (prevents wrapping)
author
Georgi Valkov
<georgi.t.valkov@gmail.com>
Tue, 23 Aug 2011 13:42:51 +0000
(16:42 +0300)
committer
Georgi Valkov
<georgi.t.valkov@gmail.com>
Tue, 23 Aug 2011 13:42:51 +0000
(16:42 +0300)
youtube-dl
patch
|
blob
|
history
diff --git
a/youtube-dl
b/youtube-dl
index d093e2558e25c29caa5a38eea95ec50bc903dab8..ac27afdc30d66c457758d4b8a8c39876640c5353 100755
(executable)
--- 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 = {