#!/bin/bash
#########################################################
#                                                       #
# This is BashStyle-NG                                  #
#                                                       #
# Licensed under GNU GENERAL PUBLIC LICENSE v3          #
#                                                       #
# Copyright Christopher Roy Bratušek                    #
#                                                       #
#########################################################

. gettext.sh
export TEXTDOMAIN="bashstyle-rc"

case ${1} in
    -h | --help )
        bashstyle-help -a "Christopher Roy Bratusek" -e "nano@jpberlin.de" -h "https://www.nanolx.org/"\
            -l "GNU GPL v3" -n "showuser" -s "$(eval_gettext "prompt function to display $ or user-set char and # or user-set char for root")"\
            -v "${BSNG_VERSION}" -y "${BSNG_YEAR}"\
            -o "$(eval_gettext "none:|---")"
    ;;

    *)
        if [ -t 1 ]; then
            COLOR_ROOT="${ered}"
            COLOR_USER="${ecolor_user}"
            COLOR_RESET="\033[0m"
        else
            COLOR_ROOT=""
            COLOR_USER=""
            COLOR_RESET=""
        fi

        if [[ ${EUID} -eq 0 ]]; then
            echo -e "${COLOR_ROOT}${root_char:-#}${COLOR_RESET}"
        else
            echo -e "${COLOR_USER}${user_char:-$}${COLOR_RESET}"
        fi
    ;;
esac
