def get_action(mod_line):
    """Function to return the type of action requested by the user for a
       given module, using the pavilion configuration syntax.  The string can
       be in one of three formats:
       1) '[mod-name]' - The module 'mod-name' is to be loaded.
       2) '[old-mod-name]->[mod-name]' - The module 'old-mod-name' is to be
                                         swapped out for the module 'mod-name'.
       3) '-[mod-name]' - The module 'mod-name' is to be unlaoded.
       :param str mod_line: String provided by the user in the config.
       :return object action: Return the appropriate object as provided by
                              the module_actions file.
    """
    if '->' in mod_line:
        return 'swap'
    elif mod_line.startswith('-'):
        return 'unload'
    else:
        return 'load'