Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
thomask77 opened this issue Jan 26, 2024 · 0 comments
Open

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

thomask77 opened this issue Jan 26, 2024 · 0 comments

Comments

@thomask77
Copy link

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
+
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant