diff options
author | W. Trevor King <wking@drexel.edu> | 2009-12-28 10:56:04 -0500 |
---|---|---|
committer | W. Trevor King <wking@drexel.edu> | 2009-12-28 10:56:04 -0500 |
commit | e2b648f2148d7b6550fb3a4bcfde4eff714a7ec6 (patch) | |
tree | 0d4e90ed1ce25f2d22a9f08a19ead6af614ef785 /libbe/command/base.py | |
parent | 4fbf5d1d222610b0775f95472fe1a60aaedea29f (diff) | |
download | bugseverywhere-e2b648f2148d7b6550fb3a4bcfde4eff714a7ec6.tar.gz |
Allow external use of Command.usage() and use CmdOptionParser.set_usage()
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
Diffstat (limited to 'libbe/command/base.py')
-rw-r--r-- | libbe/command/base.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libbe/command/base.py b/libbe/command/base.py index ac6a58b..cdb4043 100644 --- a/libbe/command/base.py +++ b/libbe/command/base.py @@ -264,11 +264,11 @@ class Command (object): 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: |