Python ArgumentParser nested arguments

argparse, python

Solution

Docopt does it just as I wanted. Terrific!

docopt('./myapp [-a [-b BVAL] | -c]')

Problem

I want to create argument parser with following signature: `./myapp [-a [-b BVAL] | -c]` In other words, user could provide argument `-b BVAL` only in case if he provided argument `-a`. It's quite easy to create mutually exclusive group of `-a` and `-c`, but I can't figure out how to create relationship `allow -b only if -a provided`

Original source