This fixes
$ python be diff -2
Usage: be [options]
be: error: no such option: -2
and we now get the correct output
$ python be diff -2
Usage: be diff [options] [REVISION]
be: error: no such option: -2
self.stdout.encoding = output_encoding
def help(self, *args):
- return '\n\n'.join([self._usage(),
+ return '\n\n'.join([self.usage(),
self._option_help(),
self._long_help().rstrip('\n')])
- def _usage(self):
+ def usage(self):
usage = 'usage: be %s [options]' % self.name
num_optional = 0
for arg in self.args:
target = add_target(bugdir, bug, params['target'])
return 0
- def _usage(self):
+ def usage(self):
return 'usage: be %(name)s BUG-ID [TARGET]\nor: be %(name)s --resolve [TARGET]' \
% vars(self)
self._option_by_name = {}
for option in self.command.options:
self._add_option(option)
+ self.set_usage(command.usage())
+
def _add_option(self, option):
option.validate()
name='args', optional=True, repeatable=True)
])
- def _usage(self):
+ def usage(self):
return 'usage: be [options] [COMMAND [command-options] [COMMAND-ARGS ...]]'
def _long_help(self):