summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Bruhin <me@the-compiler.org>2020-05-22 17:12:51 +0200
committerFlorian Bruhin <me@the-compiler.org>2020-05-22 17:12:51 +0200
commitbae1431703cf53032f14c8c92a701309fe8a6a19 (patch)
tree3e145e62e62c405f9778bfdedc1c49c7877d0967
parentabe16d5f06407805f7cfda21270cff5b306f9be5 (diff)
downloadqutebrowser-bae1431703cf53032f14c8c92a701309fe8a6a19.tar.gz
qutebrowser-bae1431703cf53032f14c8c92a701309fe8a6a19.zip
src2asciidoc: Make sure usage lines are generated with fixed width
Due to a change in Python 3.8, the output depended on the calling terminal's width. Set a fixed with of 200 (rather than 80) so that we always have the expanded version for the generated documentation. See #5393 and https://github.com/python/cpython/commit/74102c9a5f2327c4fc47feefa072854a53551d1f#diff-837b312b1f3508216ace6adb46492836
-rw-r--r--doc/help/commands.asciidoc17
-rwxr-xr-xscripts/dev/src2asciidoc.py5
2 files changed, 10 insertions, 12 deletions
diff --git a/doc/help/commands.asciidoc b/doc/help/commands.asciidoc
index 7c8da37a8..a6a5c3e87 100644
--- a/doc/help/commands.asciidoc
+++ b/doc/help/commands.asciidoc
@@ -286,8 +286,7 @@ Set all settings back to their default.
[[config-cycle]]
=== config-cycle
-Syntax: +:config-cycle [*--pattern* 'pattern'] [*--temp*] [*--print*]
- 'option' ['values' ['values' ...]]+
+Syntax: +:config-cycle [*--pattern* 'pattern'] [*--temp*] [*--print*] 'option' ['values' ['values' ...]]+
Cycle an option between multiple values.
@@ -608,8 +607,7 @@ Show help about a command or setting.
[[hint]]
=== hint
-Syntax: +:hint [*--mode* 'mode'] [*--add-history*] [*--rapid*] [*--first*]
- ['group'] ['target'] ['args' ['args' ...]]+
+Syntax: +:hint [*--mode* 'mode'] [*--add-history*] [*--rapid*] [*--first*] ['group'] ['target'] ['args' ['args' ...]]+
Start hinting.
@@ -866,8 +864,7 @@ Do nothing.
[[open]]
=== open
-Syntax: +:open [*--related*] [*--bg*] [*--tab*] [*--window*] [*--secure*] [*--private*]
- ['url']+
+Syntax: +:open [*--related*] [*--bg*] [*--tab*] [*--window*] [*--secure*] [*--private*] ['url']+
Open a URL in the current/[count]th tab.
@@ -1197,9 +1194,7 @@ Load a session.
[[session-save]]
=== session-save
-Syntax: +:session-save [*--current*] [*--quiet*] [*--force*] [*--only-active-window*]
- [*--with-private*]
- ['name']+
+Syntax: +:session-save [*--current*] [*--quiet*] [*--force*] [*--only-active-window*] [*--with-private*] ['name']+
Save a session.
@@ -1263,9 +1258,7 @@ Set a mark at the current scroll position in the current tab.
[[spawn]]
=== spawn
-Syntax: +:spawn [*--userscript*] [*--verbose*] [*--output*] [*--output-messages*]
- [*--detach*]
- 'cmdline'+
+Syntax: +:spawn [*--userscript*] [*--verbose*] [*--output*] [*--output-messages*] [*--detach*] 'cmdline'+
Spawn an external command.
diff --git a/scripts/dev/src2asciidoc.py b/scripts/dev/src2asciidoc.py
index 51f4a3633..70df0ebe0 100755
--- a/scripts/dev/src2asciidoc.py
+++ b/scripts/dev/src2asciidoc.py
@@ -59,6 +59,11 @@ class UsageFormatter(argparse.HelpFormatter):
argparse.HelpFormatter while copying 99% of the code :-/
"""
+ def __init__(self, prog, indent_increment=2, max_help_position=24,
+ width=200):
+ """Override __init__ to set a fixed width as default."""
+ super().__init__(prog, indent_increment, max_help_position, width)
+
def _format_usage(self, usage, actions, groups, _prefix):
"""Override _format_usage to not add the 'usage:' prefix."""
return super()._format_usage(usage, actions, groups, '')