Download all available updates so that they can be installed later with the
    ``update`` or ``update_all`` functions. It returns a list of updates that
    are now downloaded.

    :param bool recommended: If set to True, only install the recommended
        updates. If set to False (default) all updates are installed.

    :param bool restart: Set this to False if you do not want to install updates
        that require a restart. Default is True

    :return: A list containing all downloaded updates on the system.
    :rtype: list

    CLI Example:

    .. code-block:: bash

       salt '*' softwareupdate.download_all

def download_all(recommended=False, restart=True):
    '''
    Download all available updates so that they can be installed later with the
    ``update`` or ``update_all`` functions. It returns a list of updates that
    are now downloaded.

    :param bool recommended: If set to True, only install the recommended
        updates. If set to False (default) all updates are installed.

    :param bool restart: Set this to False if you do not want to install updates
        that require a restart. Default is True

    :return: A list containing all downloaded updates on the system.
    :rtype: list

    CLI Example:

    .. code-block:: bash

       salt '*' softwareupdate.download_all
    '''
    to_download = _get_available(recommended, restart)

    for name in to_download:
        download(name)

    return list_downloads()