##// END OF EJS Templates
cmdutil: return underscore-separate name from check_at_most_one_arg()...
Martin von Zweigbergk -
r44394:dfac2588 default
parent child Browse files
Show More
@@ -265,13 +265,17 b' def check_at_most_one_arg(opts, *args):'
265
265
266 Returns the unique argument or None if none of them were specified.
266 Returns the unique argument or None if none of them were specified.
267 """
267 """
268
269 def to_display(name):
270 return name.replace(b'_', b'-')
271
268 previous = None
272 previous = None
269 for x in args:
273 for x in args:
270 if opts.get(x):
274 if opts.get(x):
271 x = x.replace(b'_', b'-')
272 if previous:
275 if previous:
273 raise error.Abort(
276 raise error.Abort(
274 _(b'cannot specify both --%s and --%s') % (previous, x)
277 _(b'cannot specify both --%s and --%s')
278 % (to_display(previous), to_display(x))
275 )
279 )
276 previous = x
280 previous = x
277 return previous
281 return previous
General Comments 0
You need to be logged in to leave comments. Login now