-
Notifications
You must be signed in to change notification settings - Fork 41
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
Support for # comments #112
Comments
Follow up: I think Otherwise |
I am the one who removed the ability to add comments in the prompt. So, just to parse the args in the same way that click does, I have to do it. |
ok, now whats the behaviour that you want to expect from this utility @thomask77 ? do you have any other way to deal with this? |
Hmm, ok. I see that came from the built-in shell_completion.py part of click. Normally click does not parse (or see!) the raw command string, but only the args[] array. But in case of click_repl, we are the shell and have to remove comments before invoking click. |
When you do myprogram foo bar # this is a comment in (If you want to pass a argument containing a #, normal shell escape rules apply. Use # or enclose in " " / ' '.) click-repl should match this behavior, and also remove the comment before any further processing. |
When feeding prepared scripts to click-repl, it would be useful to support # comments.
shlex already supports this feature, but click-repl explicitly disables it (why?):
As a workaround, I vendored click-repl and commented out that line.
Additionally, this needs a check to skip processing if the resulting args are empty:
The text was updated successfully, but these errors were encountered: