Mercurial > python-cmd2
comparison cmd2.py @ 420:b6beae2a2f46
raise a specific error overriding optparse .error
author | catherine.devlin@gmail.com |
---|---|
date | Wed, 02 Feb 2011 05:26:37 -0800 |
parents | fd8a2da973cb |
children | fc63f0aad022 |
comparison
equal
deleted
inserted
replaced
419:fd8a2da973cb | 420:b6beae2a2f46 |
---|---|
67 | 67 |
68 Print a usage message incorporating 'msg' to stderr and exit. | 68 Print a usage message incorporating 'msg' to stderr and exit. |
69 If you override this in a subclass, it should not return -- it | 69 If you override this in a subclass, it should not return -- it |
70 should either exit or raise an exception. | 70 should either exit or raise an exception. |
71 """ | 71 """ |
72 raise | 72 raise optparse.OptParseError(msg) |
73 | 73 |
74 def remaining_args(oldArgs, newArgList): | 74 def remaining_args(oldArgs, newArgList): |
75 ''' | 75 ''' |
76 Preserves the spacing originally in the argument after | 76 Preserves the spacing originally in the argument after |
77 the removal of options. | 77 the removal of options. |