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

    SHORT_OPTS="h"
    LONG_OPTS="help,name:,norefcheck,not-validate-tables,novalid,param:,rootid:,stringparam:"

    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_help
        help_name
        help_norefcheck
        help_param
        help_rootid
        help_stringparam
        help_novalid
        help_not-validate-tables
        echo
        exit 0
    fi

    # If --novalid was called, a validation check on the resulting file
    # is automatically performed
    # Checking the result requires a minimum verbosity level of 1
    [[ 1 -eq $NOVALID &&  0 -eq $VERBOSITY ]] && export VERBOSITY=1

    call_make "$SUB_CMD" "$@"
}
