You can let the administrator override the YAML settings with one flexible switch, similar to ssh(1) working with -o . This is especially useful if configuration options are numerous and subject to change.
$ myscript -o location:city=rh --option location:country=us
Now, inside the script, you can save the entire runtime configuration, combined into a hash for convenience (instead of having the scalars grow over $this_and_that_opt over time). Then, parsing the parameters would look something like this:
# First, set up %GlobalAppCfg from defaults and YAML
or whatever. You can normalize keys and configuration values, process arbitrarily deep keys / subsections / subsections, etc. This can become slippery, so you may need to key-lock this global hash.
source share