Skip to content

Repeated options (-vvv) don't give a count value #40

Open
@rdonkin

Description

@rdonkin

I was trying to get repeated -v arguments working to increase level of verbosity (as used by ssh, rsync, ansible, etc).

This seems to be supported by docopt, based on this try.docopt.org test, giving a value of 2 for the v option in output - but the example below doesn't work in docopt/docopts 0.6.3:

#  mywrapper [-h|--help] [options] [-v|-vv|-vvv|-vvvv|-vvvvv]
# 
# Options:
#   -v, --verbose                       Show verbose Ansible output
#   -vv                                 Show verbose Ansible output
#   -vvv                                Show verbose Ansible output
#   -vvvv                               Show verbose Ansible output
#   -vvvvv                              Show verbose Ansible output

Any use of -vv for example gives a usage error.

I am currently having to use options like --v3 as a workaround. Using --v=3 would be OK but not as pleasant for the user as repeating -v to get more verbose.

Any suggestions on how to do this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    blocked by docopt parserdocopts uses an upper docopt parser which has a limitation. Parser must be improved.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions