def get_value(config, key):
    """Get value from (possibly nested) configuration dictionary by using a
    single string key as used for the commandline interface (list of keys
    delimited by '-' or '_').
    """
    keys = key.replace('-', '_').split('_')
    for key in keys[:-1]:
        config = config[key]
    return config[keys[-1]]