Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

options.py: make --usage just print the usage message.

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...
commit c078168c16a21eb6cabf02f75a918a0874793976 1 parent c8a4adc
@apenwarr authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/bup/options.py
View
4 lib/bup/options.py
@@ -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()
@@ -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:]]
Please sign in to comment.
Something went wrong with that request. Please try again.