# -*-Shell-script-*-
#
# Copyright (C) 2015-2020 SUSE Software Solutions Germany GmbH
#
# Author:
# Frank Sundermeyer <fsundermeyer at opensuse dot org>
#
###########################################################################
#
#  Package HTML
#
#  Subcommand: package-html
#
###########################################################################
function package-html {
    local SHORT_OPTS LONG_OPTS SUB_CMD
    SUB_CMD=$1
    shift

    SHORT_OPTS="h"
    LONG_OPTS="css:,desktopfiles,documentfiles,help,html5,name:,not-validate-tables,pagefiles,param:,rootid:,set-date:,single,statdir:,stringparam:,xsltparam:"

    parse_args "$SHORT_OPTS" "$LONG_OPTS" "$SUB_CMD" "$@"
    eval set -- "$P_REMAIN_ARGS"

    #------ Computing the values returned from the parser -----
    if [[ 1 -eq $P_HELP ]]; then
        help_scmd_head "$SUB_CMD" "${HELP_SUBCOMMAND[$SUB_CMD]}"
        help_css
        help_desktopfiles
        help_documentfiles
        help_help
        help_html5
        help_name
        help_not-validate-tables
        help_pagefiles
        help_param
        help_rootid
        help_set-date
        help_single
        help_statdir
        help_stringparam "creates the .html files from the profiled sources"
        echo
        exit 0
    fi


    [[ -n "$P_CSS" ]]          && export HTML_CSS="$P_CSS"

    # We always want to start with a clean HTML result directory for
    # package-html
    #
    [[ "package-html" = "$SUB_CMD" ]] && export CLEAN_DIR=1

    call_make "$SUB_CMD" "$@"
}
