-
Notifications
You must be signed in to change notification settings - Fork 15
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
Can not pass options to the script executed by ipython #20
Comments
I found a way, though it's a strange one: |
To make it doesn't look strange, the proper syntax would be But I agree that Not sure if it could be a good idea to change this behavior. |
Hmm. Looks like I got the issue wrong. First example actually is not related to pallets/click#619. |
This actually doesn't work as expected (as of my sense), and it changed behavior in IPython 8.x (with IPython<8 it results in error and non-zero exit code instead of a WARNING log message). But still I don't think we should do anything with it, because passing options after the filename argument matches the
|
Oh. Sorry, it looks like I got the message a little bit wrong again :-). |
Not sure what to do with this :-). Probably we can just document it in the README. Any thoughts are welcome. |
Maybe it will be ripe for an easy solution after pallets/click#2205 is resolved. README shouldn't hurt, but just the ability to find this issue with a strange/not strange solution should save people time. |
Unlike the default Flask shell, this one allows to specify a script to execute, just like outside of Flask do
ipython script.py
andpython script.py
. However passing options to a script invoked that way may require a preceding--
separator, which is being dropped byclick
library and never makes it toIPython.start_ipython(argv=ipython_args,
Demonstration:
Works as expected:
Doesn't work as expected:
Expected result in the second case:
It seems that the required feature is missing in
click
, though may be added in pallets/click#2205 (see also pallets/click#619 and pallets/click#1340).I realize that this may not have been a planned feature, but this would be a nice extra thing that the default Flask shell doesn't offer.
The text was updated successfully, but these errors were encountered: