A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/docopt/docopt/issues/85 below:

docopt 0.6 fails to handle very simple usage message with two subcommands · Issue #85 · docopt/docopt · GitHub

There's a rather serious regression in docopt 0.6.

The following program fails to parse a simple "fs fail --loglevel
5". Instead it prints the usage message:

#! /usr/bin/env python

"""
Usage:
  fs good [options]
  fs fail [options]

Options:
      --loglevel=<level>       loglevel
"""

import docopt
print docopt.docopt(__doc__)

i.e. with docopt 0.6 I get

[dev]  ~/ % ./fs good --loglevel 5
{'--loglevel': '5',
 'fail': False,
 'good': True}
[dev]  ~/ % ./fs fail --loglevel 5
Usage:
  fs good [options]
  fs fail [options]

Without the --loglevel parameter it's working:

[dev]  ~/ % ./fs fail
{'--loglevel': None,
 'fail': True,
 'good': False}

with 0.5 I get the expected results:

[dev]  ~/ % ./fs good --loglevel 5
{'--loglevel': '5',
 'fail': False,
 'good': True}
[dev]  ~/ % ./fs fail --loglevel 5
{'--loglevel': '5',
 'fail': True,
 'good': False}

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4