A pair of python3 scripts for importing. I wrote these to facilitate writing wrappers external commands, when replacing some shell scripts. There might be better ways to do it (including checking for libraries in lieu of commands) but in absence of that possibility (looking at you, docker-compose
!), these have made things much easier...!
The arguments.py
script allows loading a parser with some defaults, as well as passing your own argparse
definitions to it. It then returns a usable dicitonary in which to look up items.
The runner.sh
script provides a convenience set of functions for runnning external commands, as well as a dry run mode predicated on use of --dry-run
from the arguments.sh
script. It also accepts a simple dict mapping extra environment variables into the existing environment