irunner command line options defer to file extensions #594

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

Comments

Projects
None yet
2 participants
@juliantaylor
Contributor

juliantaylor commented Jul 19, 2011

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

This comment has been minimized.

Show comment Hide comment
@juliantaylor

juliantaylor Jul 19, 2011

Contributor

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

Contributor

juliantaylor commented Jul 19, 2011

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

@takluyver

This comment has been minimized.

Show comment Hide comment
@takluyver

takluyver Jul 19, 2011

Owner

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.

Owner

takluyver commented Jul 19, 2011

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

This comment has been minimized.

Show comment Hide comment
@takluyver

takluyver Jul 19, 2011

Owner

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

Owner

takluyver commented Jul 19, 2011

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

This comment has been minimized.

Show comment Hide comment
@takluyver

takluyver Jul 23, 2011

Owner

Merged in at 10c2367.

Owner

takluyver commented Jul 23, 2011

Merged in at 10c2367.

@takluyver takluyver closed this Jul 23, 2011

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