##// END OF EJS Templates
GetoptErrors when invoking magics etc. with wrong args ...
vivainio -
r156:7ccefa03
parent child
Show More
@@ -1,7 +1,7
1 # -*- coding: utf-8 -*-
1 # -*- coding: utf-8 -*-
2 """Magic functions for InteractiveShell.
2 """Magic functions for InteractiveShell.
3
3
4 $Id: Magic.py 1092 2006-01-27 23:56:32Z vivainio $"""
4 $Id: Magic.py 1094 2006-01-28 00:47:41Z vivainio $"""
5
5
6 #*****************************************************************************
6 #*****************************************************************************
7 # Copyright (C) 2001 Janko Hauser <jhauser@zscout.de> and
7 # Copyright (C) 2001 Janko Hauser <jhauser@zscout.de> and
@@ -33,7 +33,7 import time
33 import cPickle as pickle
33 import cPickle as pickle
34 import textwrap
34 import textwrap
35 from cStringIO import StringIO
35 from cStringIO import StringIO
36 from getopt import getopt
36 from getopt import getopt,GetoptError
37 from pprint import pprint, pformat
37 from pprint import pprint, pformat
38
38
39 # profile isn't bundled by default in Debian for license reasons
39 # profile isn't bundled by default in Debian for license reasons
@@ -306,7 +306,11 license. To use profiling, please install"python2.3-profiler" from non-free.""")
306 # need to look for options
306 # need to look for options
307 argv = shlex_split(arg_str)
307 argv = shlex_split(arg_str)
308 # Do regular option processing
308 # Do regular option processing
309 opts,args = getopt(argv,opt_str,*long_opts)
309 try:
310 opts,args = getopt(argv,opt_str,*long_opts)
311 except GetoptError,e:
312 raise GetoptError('%s ( allowed: "%s" %s)' % (e.msg,opt_str,
313 " ".join(long_opts)))
310 for o,a in opts:
314 for o,a in opts:
311 if o.startswith('--'):
315 if o.startswith('--'):
312 o = o[2:]
316 o = o[2:]
@@ -27,6 +27,10
27 * usage.py, Magic.py: added %quickref
27 * usage.py, Magic.py: added %quickref
28
28
29 * iplib.py: ESC_PAREN fixes: /f 1 2 -> f(1,2), not f(1 2).
29 * iplib.py: ESC_PAREN fixes: /f 1 2 -> f(1,2), not f(1 2).
30
31 * GetoptErrors when invoking magics etc. with wrong args
32 are now more helpful:
33 GetoptError: option -l not recognized (allowed: "qb" )
30
34
31 2006-01-25 Fernando Perez <Fernando.Perez@colorado.edu>
35 2006-01-25 Fernando Perez <Fernando.Perez@colorado.edu>
32
36
General Comments 0
You need to be logged in to leave comments. Login now