diff options
author | Philipp Albrecht <palbrecht@mailbox.org> | 2023-08-02 12:45:29 +0200 |
---|---|---|
committer | Philipp Albrecht <palbrecht@mailbox.org> | 2023-08-11 09:02:01 +0200 |
commit | 80b4d2f243b5ba9f097da3616840cf62ad6aa604 (patch) | |
tree | 10ed4f1b3237b806a63b8d90b97db51dd8ea90aa | |
parent | 2fe4864b78486f96e0aa13fc9986388b7fc7a4eb (diff) | |
download | qutebrowser-80b4d2f243b5ba9f097da3616840cf62ad6aa604.tar.gz qutebrowser-80b4d2f243b5ba9f097da3616840cf62ad6aa604.zip |
Rename :later to :cmd-later
Group commands related to commands/commandline by prefixing them with `cmd-`.
-rw-r--r-- | doc/help/commands.asciidoc | 32 | ||||
-rw-r--r-- | qutebrowser/misc/utilcmds.py | 5 | ||||
-rwxr-xr-x | scripts/dev/build_release.py | 2 | ||||
-rwxr-xr-x | scripts/dev/quit_segfault_test.sh | 2 | ||||
-rw-r--r-- | tests/end2end/features/prompts.feature | 2 | ||||
-rw-r--r-- | tests/end2end/features/utilcmds.feature | 18 |
6 files changed, 31 insertions, 30 deletions
diff --git a/doc/help/commands.asciidoc b/doc/help/commands.asciidoc index 44624e9dd..1c67f9d23 100644 --- a/doc/help/commands.asciidoc +++ b/doc/help/commands.asciidoc @@ -40,6 +40,7 @@ possible to run or bind multiple commands by separating them with `;;`. |<<clear-messages,clear-messages>>|Clear all message notifications. |<<click-element,click-element>>|Click the element matching the given filter. |<<close,close>>|Close the current window. +|<<cmd-later,cmd-later>>|Execute a command after some time. |<<cmd-repeat,cmd-repeat>>|Repeat a given command. |<<config-clear,config-clear>>|Set all settings back to their default. |<<config-cycle,config-cycle>>|Cycle an option between multiple values. @@ -76,7 +77,6 @@ possible to run or bind multiple commands by separating them with `;;`. |<<insert-text,insert-text>>|Insert text at cursor position. |<<jseval,jseval>>|Evaluate a JavaScript string. |<<jump-mark,jump-mark>>|Jump to the mark named by `key`. -|<<later,later>>|Execute a command after some time. |<<macro-record,macro-record>>|Start or stop recording a macro. |<<macro-run,macro-run>>|Run a recorded macro. |<<message-error,message-error>>|Show an error message in the statusbar. @@ -281,6 +281,21 @@ The given filter needs to result in exactly one element, otherwise, an error is === close Close the current window. +[[cmd-later]] +=== cmd-later +Syntax: +:cmd-later 'duration' 'command'+ + +Execute a command after some time. + +==== positional arguments +* +'duration'+: Duration to wait in format XhYmZs or a number for milliseconds. +* +'command'+: The command to run, with optional args. + +==== note +* This command does not split arguments after the last argument and handles quotes literally. +* With this command, +;;+ is interpreted literally instead of splitting off a second command. +* This command does not replace variables like +\{url\}+. + [[cmd-repeat]] === cmd-repeat Syntax: +:cmd-repeat 'times' 'command'+ @@ -798,21 +813,6 @@ Jump to the mark named by `key`. ==== positional arguments * +'key'+: mark identifier; capital indicates a global mark -[[later]] -=== later -Syntax: +:later 'duration' 'command'+ - -Execute a command after some time. - -==== positional arguments -* +'duration'+: Duration to wait in format XhYmZs or a number for milliseconds. -* +'command'+: The command to run, with optional args. - -==== note -* This command does not split arguments after the last argument and handles quotes literally. -* With this command, +;;+ is interpreted literally instead of splitting off a second command. -* This command does not replace variables like +\{url\}+. - [[macro-record]] === macro-record Syntax: +:macro-record ['register']+ diff --git a/qutebrowser/misc/utilcmds.py b/qutebrowser/misc/utilcmds.py index 971dd40b0..6ec83bea8 100644 --- a/qutebrowser/misc/utilcmds.py +++ b/qutebrowser/misc/utilcmds.py @@ -26,9 +26,10 @@ from qutebrowser.utils.version import pastebin_version from qutebrowser.qt import sip -@cmdutils.register(maxsplit=1, no_cmd_split=True, no_replace_variables=True) +@cmdutils.register(maxsplit=1, no_cmd_split=True, no_replace_variables=True, + deprecated_name='later') @cmdutils.argument('win_id', value=cmdutils.Value.win_id) -def later(duration: str, command: str, win_id: int) -> None: +def cmd_later(duration: str, command: str, win_id: int) -> None: """Execute a command after some time. Args: diff --git a/scripts/dev/build_release.py b/scripts/dev/build_release.py index 73689ea88..b55624b8d 100755 --- a/scripts/dev/build_release.py +++ b/scripts/dev/build_release.py @@ -119,7 +119,7 @@ def _smoke_test_run( '--temp-basedir', *args, 'about:blank', - ':later 500 quit', + ':cmd-later 500 quit', ] return subprocess.run(argv, check=True, capture_output=True) diff --git a/scripts/dev/quit_segfault_test.sh b/scripts/dev/quit_segfault_test.sh index 389f125b9..e8bfaed6b 100755 --- a/scripts/dev/quit_segfault_test.sh +++ b/scripts/dev/quit_segfault_test.sh @@ -7,7 +7,7 @@ while :; do exit=0 while (( exit == 0 )); do duration=$(( RANDOM % 10000 )) - python3 -m qutebrowser --debug ":later $duration quit" http://www.heise.de/ + python3 -m qutebrowser --debug ":cmd-later $duration quit" http://www.heise.de/ exit=$? done echo "$(date) $exit $duration" >> crash.log diff --git a/tests/end2end/features/prompts.feature b/tests/end2end/features/prompts.feature index 673c4f567..9cf880061 100644 --- a/tests/end2end/features/prompts.feature +++ b/tests/end2end/features/prompts.feature @@ -487,7 +487,7 @@ Feature: Prompts Scenario: Getting question in command mode When I open data/hello.txt - And I run :later 500 quickmark-save + And I run :cmd-later 500 quickmark-save And I run :set-cmd-text : And I wait for a prompt And I run :prompt-accept prompt-in-command-mode diff --git a/tests/end2end/features/utilcmds.feature b/tests/end2end/features/utilcmds.feature index 75e99ec70..da99e62d3 100644 --- a/tests/end2end/features/utilcmds.feature +++ b/tests/end2end/features/utilcmds.feature @@ -4,27 +4,27 @@ Feature: Miscellaneous utility commands exposed to the user. Given I open data/scroll/simple.html And I run :tab-only - ## :later + ## :cmd-later - Scenario: :later before - When I run :later 500 scroll down + Scenario: :cmd-later before + When I run :cmd-later 500 scroll down Then the page should not be scrolled # wait for scroll to execute so we don't ruin our future And the page should be scrolled vertically - Scenario: :later after - When I run :later 500 scroll down + Scenario: :cmd-later after + When I run :cmd-later 500 scroll down And I wait 0.6s Then the page should be scrolled vertically # for some reason, argparser gives us the error instead, see #2046 @xfail - Scenario: :later with negative delay - When I run :later -1 scroll down + Scenario: :cmd-later with negative delay + When I run :cmd-later -1 scroll down Then the error "I can't run something in the past!" should be shown - Scenario: :later with humongous delay - When I run :later 36893488147419103232 scroll down + Scenario: :cmd-later with humongous delay + When I run :cmd-later 36893488147419103232 scroll down Then the error "Numeric argument is too large for internal int representation." should be shown ## :cmd-repeat |