def parseConfig(configFromFile, configFromCmd, mode="raw"):
    """
    This fuction merges configuration from config file and configuration from
    command line. Command line options have preference over config file.

    Args:
        * configFromFile:  returned from readConfig functions
        * configFromCmd:  args from command line
        * mode:  parse mode option

    Returns:
        configuration   :  an array with the whole configuration
    """
    conf = {}
    if mode is "lz4":
        conf["workmode"] = "lz4"
        print("mode lz4")
    elif mode is "human":
        conf["workmode"] = "human"
    elif configFromFile['workmode'] is not None:
        conf["workmode"] = configFromFile['workmode']
    else:
        conf["workmode"] = "raw"

    conf["keyfile"] = configFromCmd.keyfile or configFromFile['keyfile']
    return conf