diff --git a/IPython/lib/irunner.py b/IPython/lib/irunner.py index 66386bc..8175168 100755 --- a/IPython/lib/irunner.py +++ b/IPython/lib/irunner.py @@ -16,7 +16,7 @@ simply run the module as a script: This is an extension of Ken Schutte 's script contributed on the ipython-user list: -http://scipy.net/pipermail/ipython-user/2006-May/001705.html +http://mail.scipy.org/pipermail/ipython-user/2006-May/003539.html NOTES: @@ -410,7 +410,6 @@ def main(): parser = optparse.OptionParser(usage=MAIN_USAGE) newopt = parser.add_option - parser.set_defaults(mode='ipython') newopt('--ipython',action='store_const',dest='mode',const='ipython', help='IPython interactive runner (default).') newopt('--python',action='store_const',dest='mode',const='python', @@ -430,7 +429,9 @@ def main(): modes = {'.ipy':'ipython', '.py':'python', '.sage':'sage'} - mode = modes.get(ext,opts.mode) + mode = modes.get(ext,"ipython") + if opts.mode: + mode = opts.mode runners[mode]().main(args) if __name__ == '__main__': diff --git a/docs/man/irunner.1 b/docs/man/irunner.1 index 56353a1..2623d7c 100644 --- a/docs/man/irunner.1 +++ b/docs/man/irunner.1 @@ -10,6 +10,8 @@ .SH DESCRIPTION irunner is an interface to the various interactive runners available in IPython's \fBirunner\fP module. +It can used to run scripts as if they where typed up +interactively. .PP The already implemented runners are listed below; adding one for a new program is a trivial task, see the source @@ -42,7 +44,7 @@ irunner.py \-\-ipython \-\- \-\-interact script.ipy .SH AUTHOR \fBirunner\fP is an extension of Ken Schutte 's script contributed on the ipython-user list: -http://scipy.net/pipermail/ipython-user/2006-May/001705.html +http://mail.scipy.org/pipermail/ipython-user/2006-May/003539.html .PP This manual page was written by Bernd Zeimetz , for the Debian project (but may be used by others). Modified by Fernando Perez