If I’ve helped you in some way, consider giving back by using the affiliate links or by donating below. Every bit helps.

Implementing sub-commands in Python with argparse

Long chains of easier-to-read sub-commands have come to be all the rage these days, or maybe it’s just me. To fit into contemporary parlance, I feel like most programs historically used prefixes for sub-commands like -, like find’s -exec. These days, calling an application with docker volume ls or kubectl get all --all-namespaces is an everyday thing. Nowadays sed -i would be written like sed inplace.


© 2021. All rights reserved.

Powered by Hydejack v9.1.2