Add count info in commands.

This commit is contained in:
Florian Bruhin 2014-09-13 00:33:15 +02:00
parent 80ef0782d5
commit 38c341e3ea
3 changed files with 71 additions and 1 deletions

View File

@ -51,6 +51,9 @@
=== back === back
Go back in the history of the current tab. Go back in the history of the current tab.
==== count
How many pages to go back.
[[bind]] [[bind]]
=== bind === bind
Syntax: +:bind 'key' 'command' ['mode']+ Syntax: +:bind 'key' 'command' ['mode']+
@ -67,6 +70,9 @@ Bind a key to a command.
=== cancel-download === cancel-download
Cancel the first/[count]th download. Cancel the first/[count]th download.
==== count
The index of the download to cancel.
[[download-page]] [[download-page]]
=== download-page === download-page
Download the current page. Download the current page.
@ -75,6 +81,9 @@ Download the current page.
=== forward === forward
Go forward in the history of the current tab. Go forward in the history of the current tab.
==== count
How many pages to go forward.
[[get]] [[get]]
=== get === get
Syntax: +:get 'section' 'option'+ Syntax: +:get 'section' 'option'+
@ -183,6 +192,9 @@ Open a URL in the current/[count]th tab.
* +*-b*+, +*--bg*+: Open in a new background tab. * +*-b*+, +*--bg*+: Open in a new background tab.
* +*-t*+, +*--tab*+: Open in a new tab. * +*-t*+, +*--tab*+: Open in a new tab.
==== count
The tab index to open the URL in, or None.
[[paste]] [[paste]]
=== paste === paste
Syntax: +:paste [*--sel*] [*--tab*] [*--bg*]+ Syntax: +:paste [*--sel*] [*--tab*] [*--bg*]+
@ -214,6 +226,9 @@ Print the current/[count]th tab.
==== optional arguments ==== optional arguments
* +*-p*+, +*--preview*+: Show preview instead of printing. * +*-p*+, +*--preview*+: Show preview instead of printing.
==== count
The tab index to print, or None.
[[quickmark-add]] [[quickmark-add]]
=== quickmark-add === quickmark-add
Syntax: +:quickmark-add 'url' 'name'+ Syntax: +:quickmark-add 'url' 'name'+
@ -249,6 +264,9 @@ Quit qutebrowser.
=== reload === reload
Reload the current/[count]th tab. Reload the current/[count]th tab.
==== count
The tab index to reload, or None.
[[report]] [[report]]
=== report === report
Report a bug in qutebrowser. Report a bug in qutebrowser.
@ -309,10 +327,16 @@ Note the {url} variable which gets replaced by the current URL might be useful h
=== stop === stop
Stop loading in the current/[count]th tab. Stop loading in the current/[count]th tab.
==== count
The tab index to stop, or None.
[[tab-close]] [[tab-close]]
=== tab-close === tab-close
Close the current/[count]th tab. Close the current/[count]th tab.
==== count
The tab index to close, or None
[[tab-focus]] [[tab-focus]]
=== tab-focus === tab-focus
Syntax: +:tab-focus ['index']+ Syntax: +:tab-focus ['index']+
@ -323,6 +347,9 @@ Select the tab given as argument/[count].
* +'index'+: The tab index to focus, starting with 1. The special value `last` focuses the last focused tab. * +'index'+: The tab index to focus, starting with 1. The special value `last` focuses the last focused tab.
==== count
The tab index to focus, starting with 1.
[[tab-move]] [[tab-move]]
=== tab-move === tab-move
Syntax: +:tab-move ['direction']+ Syntax: +:tab-move ['direction']+
@ -333,10 +360,17 @@ Move the current tab.
* +'direction'+: `+` or `-` for relative moving, not given for absolute moving. * +'direction'+: `+` or `-` for relative moving, not given for absolute moving.
==== count
If moving absolutely: New position (default: 0) If moving relatively: Offset.
[[tab-next]] [[tab-next]]
=== tab-next === tab-next
Switch to the next tab, or switch [count] tabs forward. Switch to the next tab, or switch [count] tabs forward.
==== count
How many tabs to switch forward.
[[tab-only]] [[tab-only]]
=== tab-only === tab-only
Close all tabs except for the current one. Close all tabs except for the current one.
@ -345,6 +379,9 @@ Close all tabs except for the current one.
=== tab-prev === tab-prev
Switch to the previous tab, or switch [count] tabs back. Switch to the previous tab, or switch [count] tabs back.
==== count
How many tabs to switch back.
[[unbind]] [[unbind]]
=== unbind === unbind
Syntax: +:unbind 'key' ['mode']+ Syntax: +:unbind 'key' ['mode']+
@ -381,14 +418,23 @@ The zoom can be given as argument or as [count]. If neither of both is given, th
==== positional arguments ==== positional arguments
* +'zoom'+: The zoom percentage to set. * +'zoom'+: The zoom percentage to set.
==== count
The zoom percentage to set.
[[zoom-in]] [[zoom-in]]
=== zoom-in === zoom-in
Increase the zoom level for the current tab. Increase the zoom level for the current tab.
==== count
How many steps to zoom in.
[[zoom-out]] [[zoom-out]]
=== zoom-out === zoom-out
Decrease the zoom level for the current tab. Decrease the zoom level for the current tab.
==== count
How many steps to zoom out.
== Hidden commands == Hidden commands
.Quick reference .Quick reference
@ -569,6 +615,9 @@ Scroll the current tab by 'count * dx/dy'.
* +'dx'+: How much to scroll in x-direction. * +'dx'+: How much to scroll in x-direction.
* +'dy'+: How much to scroll in x-direction. * +'dy'+: How much to scroll in x-direction.
==== count
multiplier
[[scroll-page]] [[scroll-page]]
=== scroll-page === scroll-page
Syntax: +:scroll-page 'x' 'y'+ Syntax: +:scroll-page 'x' 'y'+
@ -579,6 +628,9 @@ Scroll the frame page-wise.
* +'x'+: How many pages to scroll to the right. * +'x'+: How many pages to scroll to the right.
* +'y'+: How many pages to scroll down. * +'y'+: How many pages to scroll down.
==== count
multiplier
[[scroll-perc]] [[scroll-perc]]
=== scroll-perc === scroll-perc
Syntax: +:scroll-perc [*--horizontal*] ['perc']+ Syntax: +:scroll-perc [*--horizontal*] ['perc']+
@ -593,14 +645,23 @@ The percentage can be given either as argument or as count. If no percentage is
==== optional arguments ==== optional arguments
* +*-x*+, +*--horizontal*+: Scroll horizontally instead of vertically. * +*-x*+, +*--horizontal*+: Scroll horizontally instead of vertically.
==== count
Percentage to scroll.
[[search-next]] [[search-next]]
=== search-next === search-next
Continue the search to the ([count]th) next term. Continue the search to the ([count]th) next term.
==== count
How many elements to ignore.
[[search-prev]] [[search-prev]]
=== search-prev === search-prev
Continue the search to the ([count]th) previous term. Continue the search to the ([count]th) previous term.
==== count
How many elements to ignore.
== Debugging commands == Debugging commands
These commands are mainly intended for debugging. They are hidden if qutebrowser was started without the `--debug`-flag. These commands are mainly intended for debugging. They are hidden if qutebrowser was started without the `--debug`-flag.

View File

@ -359,7 +359,11 @@ class DownloadManager(QObject):
@cmdutils.register(instance='downloadmanager') @cmdutils.register(instance='downloadmanager')
def cancel_download(self, count=1): def cancel_download(self, count=1):
"""Cancel the first/[count]th download.""" """Cancel the first/[count]th download.
Args:
count: The index of the download to cancel.
"""
if count == 0: if count == 0:
return return
try: try:

View File

@ -181,6 +181,11 @@ def _get_command_doc(name, cmd):
raise KeyError("No description for arg {} of command " raise KeyError("No description for arg {} of command "
"'{}'!".format(e, cmd.name)) "'{}'!".format(e, cmd.name))
if cmd.count:
output.append("")
output.append("==== count")
output.append(parser.arg_descs['count'])
output.append("") output.append("")
output.append("") output.append("")
return '\n'.join(output) return '\n'.join(output)