I was wondering if I could have dependent options in docopt.
example:
"""
Description:
Flash a system with the manufacturing software from the specifiedx folder.
Usage:
flash_drop.py (--drop-dir=<DIR>) [--factory-reset=<BOOL>] [--flash-all=<BOOL>] [--flash-system1=<BOOL> | --flash-system2=<BOOL>]
flash_drop.py -h | --help
flash_drop.py --version
Options:
-h --help Show this screen.
--version Show version.
--drop-dir=DIR Path to the drop directory
--factory-reset=BOOL Factory reset the chips on all selected devices. [default: False]
--flash-all=BOOL Flash all devices. [default: False]
--flash-system1=BOOL Flash first system. [default: False]
--flash-system2=BOOL Flash second system. [default: False]
"""
Namely, the value of an option is ignored if a previous option hasn't been selected. So for instance, the value for --flash-system2
is ignored unless --flash-system1
is set