def args_to_dict(args) -> dict:
    """Convert args to dict
    :param args: command line arguments
    :return: conf in dict containing command line arguments
    """
    keys_to_remove = {"command", "foreground", "config"}
    args_dict = vars(args)
    ret = {}

    for key, value in args_dict.items():
        if key not in keys_to_remove and value is not None:
            ret[key] = value

    return ret