DEV Community

Discussion on: Parallel features with Git

Collapse
 
cipharius profile image
Valts Liepiņš

As you've already noticed, it's pain to maintain command line arguments as nested if statements. Usually CLI tools approach argument parsing problem more decleratively, by defining all possible command arguments and leaving the parsing up to dedicated argument parsing library.

Python comes with one called argparse. Take a look at the examples in the documentation and you'll see the benefits of this sort of approach: docs.python.org/3/library/argparse...

Besides specifying arguments like this avoids the issue of complicated merges!