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

    SHORT_OPTS="h"
    LONG_OPTS="cropmarks,draft,formatter:,help,grayscale,lean,meta,name:,norefcheck,not-validate-tables,param:,remarks,rootid:,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_cropmarks
        help_draft
        help_formatter
        help_grayscale_pdf
        help_help
        help_lean
        help_meta
        help_name
        help_not-validate-tables
        help_norefcheck
        help_param
        help_remarks
        help_rootid
        help_stringparam "creates the .fo file from the profiled sources"
        echo
        exit 0
    fi

    call_make "$SUB_CMD" "$@"
}
