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

irunner command line options defer to file extensions #594

Closed
juliantaylor opened this issue Jul 19, 2011 · 4 comments
Closed

irunner command line options defer to file extensions #594

juliantaylor opened this issue Jul 19, 2011 · 4 comments
Milestone

Comments

@juliantaylor
Copy link
Contributor

Running irunner --ipython script.py currently sees the .py extension, and chooses the Python runner. Command line options should probably override file extensions.


Original bug report:

when running irunner from git head with --interact or -i:

$ irunner --interact /tmp/test.py
Usage:
irunner [options] file_to_run

...

irunner: error: no such option: --interact

also the --ipython option does not seem to work, it has regular python prompts and not the ipython prompts:
$ irunner /tmp/test.py

print "test"

@juliantaylor
Copy link
Contributor Author

forget that I am just to stupid to read the help message:
irunner --ipython -- --interact script.py works

@takluyver
Copy link
Member

It seems that the file extension takes priority over the options passed, so a .py file is run in PythonRunner. It makes sense that the command line flags should have priority over file extensions, and it should be easy to change.

For --interact, make sure you follow the instructions in the usage message - you need an extra -- in before options that will be parsed to the underlying process. If I do this, it seems to work.

@takluyver takluyver reopened this Jul 19, 2011
@takluyver
Copy link
Member

Reopened because I think the command line options should take priority over file extensions, but it's lower priority.

juliantaylor added a commit to juliantaylor/ipython that referenced this issue Jul 19, 2011
@takluyver
Copy link
Member

Merged in at 10c2367.

mattvonrocketstein pushed a commit to mattvonrocketstein/ipython that referenced this issue Nov 3, 2014
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

2 participants