I am searching for a way to implement master commands for my python script. By master commands i mean one command summarizing a sequence of commands.
An example call with all commands written out:
python script.py -import model.glb -remove_small_features -decimate -bake_textures -export lowpoly.glb
An example call with the master command which leads to the same result:
python script.py -import model.glb -compact -export lowpoly.glb
Currently i am using in my python code something like:
if arguments.compact:
arguments.remove_small_features = True
arguments.decimate = True
arguments.bake_textures = True
But is there a way to represent this structure in the argparse module itself? I haven't found a way to do this. I found mutually exclusive groups which allows for parsing that certain arguments are not allowed to be together in one call but not that one argument sets the values multiple another arguments.