Skip to content
This repository
Browse code

Merge pull request #596 from juliantaylor/irunner

Fix handling of command-line flags in irunner, plus manpage updates.
  • Loading branch information...
commit 10c23676fd1d7c7c9c1587c1297e814c70d1f597 2 parents 4903337 + a55a9af
Fernando Perez authored July 22, 2011
7  IPython/lib/irunner.py
@@ -16,7 +16,7 @@
16 16
 This is an extension of Ken Schutte <kschutte-AT-csail.mit.edu>'s script
17 17
 contributed on the ipython-user list:
18 18
 
19  
-http://scipy.net/pipermail/ipython-user/2006-May/001705.html
  19
+http://mail.scipy.org/pipermail/ipython-user/2006-May/003539.html
20 20
 
21 21
 
22 22
 NOTES:
@@ -410,7 +410,6 @@ def main():
410 410
 
411 411
     parser = optparse.OptionParser(usage=MAIN_USAGE)
412 412
     newopt = parser.add_option
413  
-    parser.set_defaults(mode='ipython')
414 413
     newopt('--ipython',action='store_const',dest='mode',const='ipython',
415 414
            help='IPython interactive runner (default).')
416 415
     newopt('--python',action='store_const',dest='mode',const='python',
@@ -430,7 +429,9 @@ def main():
430 429
     modes = {'.ipy':'ipython',
431 430
              '.py':'python',
432 431
              '.sage':'sage'}
433  
-    mode = modes.get(ext,opts.mode)
  432
+    mode = modes.get(ext,"ipython")
  433
+    if opts.mode:
  434
+        mode = opts.mode
434 435
     runners[mode]().main(args)
435 436
 
436 437
 if __name__ == '__main__':
4  docs/man/irunner.1
@@ -10,6 +10,8 @@
10 10
 .SH DESCRIPTION
11 11
 irunner is an interface to the various interactive runners
12 12
 available in IPython's \fBirunner\fP module. 
  13
+It can used to run scripts as if they where typed up
  14
+interactively.
13 15
 .PP
14 16
 The already implemented runners are listed below; adding
15 17
 one for a new program is a trivial task, see the source
@@ -42,7 +44,7 @@ irunner.py \-\-ipython \-\- \-\-interact script.ipy
42 44
 .SH AUTHOR
43 45
 \fBirunner\fP is an extension of Ken Schutte <kschutte-AT-csail.mit.edu>'s
44 46
 script contributed on the ipython-user list:
45  
-http://scipy.net/pipermail/ipython-user/2006-May/001705.html
  47
+http://mail.scipy.org/pipermail/ipython-user/2006-May/003539.html
46 48
 .PP
47 49
 This manual page was written by Bernd Zeimetz <bernd@bzed.de>, for the Debian
48 50
 project (but may be used by others).  Modified by Fernando Perez

0 notes on commit 10c2367

Please sign in to comment.
Something went wrong with that request. Please try again.