By creating a comma-delimited list of command-line arguments, the parsing logic and control flow can be influenced from a single location in the code base. The trick is to eval-uate "log=utile_log" when the "-V" command-line argument is provided (or assign ARG_ARCH to the user-supplied value after "-a"). Using the $log variable invokes the function, such as in:
preprocess() {
$log "Preprocess"
}
If "-V" isn't supplied, then every invocation of $log simply returns without printing a message. The upshot is a reduction in conditional statements. Function pointers FTW. I wrote about this technique in my Typesetting Markdown series:
https://dave.autonoma.ca/blog/2019/05/22/typesetting-markdow...
Here's a rudimentary implementation and example usage to wet your whistle:
https://github.com/DaveJarvis/keenwrite/blob/master/scripts/...
https://github.com/DaveJarvis/keenwrite/blob/master/installe...