projects
/
hooke.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
bd0bf27
)
Log the troublesome command for command line option conflicts.
author
W. Trevor King
<wking@drexel.edu>
Thu, 19 Aug 2010 18:36:48 +0000
(14:36 -0400)
committer
W. Trevor King
<wking@drexel.edu>
Thu, 19 Aug 2010 18:36:48 +0000
(14:36 -0400)
hooke/ui/commandline.py
patch
|
blob
|
history
diff --git
a/hooke/ui/commandline.py
b/hooke/ui/commandline.py
index e73e22d68126af9bd04923bf32ec2870f402833d..01a66f8b9d55902647adacffcb7e01e4f07d0e53 100644
(file)
--- a/
hooke/ui/commandline.py
+++ b/
hooke/ui/commandline.py
@@
-63,15
+63,23
@@
class CommandLineParser (optparse.OptionParser):
type = a.type
if type == 'bool':
if a.default == True:
type = a.type
if type == 'bool':
if a.default == True:
- self.add_option(
- '--disable-%s' % name, dest=name, default=Default,
- action='store_false')
+ try:
+ self.add_option(
+ '--disable-%s' % name, dest=name,
+ default=Default, action='store_false')
+ except optparse.OptionConflictError, e:
+ logging.warn('error in %s: %s' % (command, e))
+ raise
self.command_opts.append(a)
continue
elif a.default == False:
self.command_opts.append(a)
continue
elif a.default == False:
- self.add_option(
- '--enable-%s' % name, dest=name, default=Default,
- action='store_true')
+ try:
+ self.add_option(
+ '--enable-%s' % name, dest=name,
+ default=Default, action='store_true')
+ except optparse.OptionConflictError, e:
+ logging.warn('error in %s: %s' % (command, e))
+ raise
self.command_opts.append(a)
continue
else:
self.command_opts.append(a)
continue
else:
@@
-79,8
+87,12
@@
class CommandLineParser (optparse.OptionParser):
elif type not in ['string', 'int', 'long', 'choice', 'float',
'complex']:
type = 'string'
elif type not in ['string', 'int', 'long', 'choice', 'float',
'complex']:
type = 'string'
- self.add_option(
- '--%s' % name, dest=name, type=type, default=Default)
+ try:
+ self.add_option(
+ '--%s' % name, dest=name, type=type, default=Default)
+ except optparse.OptionConflictError, e:
+ logging.warn('error in %s: %s' % (command, e))
+ raise
self.command_opts.append(a)
else:
self.command_args.append(a)
self.command_opts.append(a)
else:
self.command_args.append(a)