Skip to content

Commit

Permalink
options.py: make --usage just print the usage message.
Browse files Browse the repository at this point in the history
This is a relatively common option in other programs, so let's make it work
in case someone tries to use it.

Signed-off-by: Avery Pennarun <apenwarr@gmail.com>
  • Loading branch information
apenwarr committed Feb 20, 2011
1 parent c8a4adc commit c078168
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/bup/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def __init__(self, optspec, optfunc=getopt.gnu_getopt,
self.optfunc = optfunc
self._aliases = {}
self._shortopts = 'h?'
self._longopts = ['help']
self._longopts = ['help', 'usage']
self._hasparms = {}
self._defaults = {}
self._usagestr = self._gen_usage()
Expand Down Expand Up @@ -214,7 +214,7 @@ def parse(self, args):

for (k,v) in flags:
k = k.lstrip('-')
if k in ('h', '?', 'help'):
if k in ('h', '?', 'help', 'usage'):
self.usage()
if k.startswith('no-'):
k = self._aliases[k[3:]]
Expand Down

0 comments on commit c078168

Please sign in to comment.