Merge commit '7f13c9a3c31aa719144ca3afcad7af305dd2f6ed' into Carpetsmoker/relax-cmdline

This commit is contained in:
Florian Bruhin 2017-04-02 18:47:00 +02:00
commit b20267b57d
2 changed files with 14 additions and 3 deletions

View File

@ -133,7 +133,8 @@ class CommandRunner(QObject):
Yields: Yields:
ParseResult tuples. ParseResult tuples.
""" """
if not text.strip(): text = text.strip().lstrip(':').strip()
if not text:
raise cmdexc.NoSuchCommandError("No command given") raise cmdexc.NoSuchCommandError("No command given")
if aliases: if aliases:

View File

@ -538,6 +538,16 @@ Feature: Various utility commands.
When I run :message-i "Hello World" (invalid command) When I run :message-i "Hello World" (invalid command)
Then the error "message-i: no such command" should be shown Then the error "message-i: no such command" should be shown
Scenario: Multiple leading : in command
When I run :::::set-cmd-text ::::message-i "Hello World"
And I run :command-accept
Then the message "Hello World" should be shown
Scenario: Whitespace in command
When I run : : set-cmd-text : : message-i "Hello World"
And I run :command-accept
Then the message "Hello World" should be shown
# We can't run :message-i as startup command, so we use # We can't run :message-i as startup command, so we use
# :set-cmd-text # :set-cmd-text