Permalink
Browse files

Fix printing usage on exit (see #102)

  • Loading branch information...
1 parent d5b96f8 commit 10c1b390c4ab4bb4cfc6e18b8ad9023309083e00 Vladimir Keleshev committed Apr 3, 2013
Showing with 2 additions and 2 deletions.
  1. +2 −2 docopt.py
View
@@ -563,10 +563,10 @@ def docopt(doc, argv=None, help=True, version=None, options_first=False):
raise DocoptLanguageError('"usage:" (case-insensitive) not found.')
if len(usage_sections) > 1:
raise DocoptLanguageError('More than one "usage:" (case-insensitive).')
- usage = usage_sections[0]
+ DocoptExit.usage = usage_sections[0]
options = parse_defaults(doc)
- pattern = parse_pattern(formal_usage(usage), options)
+ pattern = parse_pattern(formal_usage(DocoptExit.usage), options)
# [default] syntax for argument is disabled
#for a in pattern.flat(Argument):
# same_name = [d for d in arguments if d.name == a.name]

0 comments on commit 10c1b39

Please sign in to comment.