Skip to content

Entering ". ", "/ ", etc.. shows usage #113

@thomask77

Description

@thomask77

If you enter ". ", "/ " or similar, as soon as you hit space, the usage is displayed.

As a workaround, I added the following code in _completer.py:

diff --git a/Tests/click/third_party/click_repl/_completer.py b/Tests/click/third_party/click_repl/_completer.py
index 67b8bda..6f531db 100644
--- a/Tests/click/third_party/click_repl/_completer.py
+++ b/Tests/click/third_party/click_repl/_completer.py
@@ -275,6 +275,17 @@ class ClickCompleter(Completer):
         if self.parsed_args != args:
             self.parsed_args = args
             try:
+                # 2024-01-24, tk:
+                #
+                # Without resilient_parsing, entering ". ", "^ ", etc..
+                # prints the usage. (But not "x " - strange!)
+                #
+                # I'm not sure, if this is the correct place to fix it.
+                #
+                # See https://github.com/click-contrib/click-repl/issues/113
+                #
+                self.ctx.resilient_parsing = True
+

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions