#!/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
    ext   | e) echo "${2##*.}" ;;
    name  | n) echo "${2##*/}" ;;
    noext | N) file="${2##*/}"
           echo "${file%\.*}" ;;
    path  | p) echo "${2%/*}" ;;

    *)
        bashstyle-help -a "Christopher Roy Bratusek" -e "nano@jpberlin.de" -h "https://www.nanolx.org/"\
            -l "GNU GPL v3" -n "basefile" -s "$(eval_gettext "variant of basename for files")"\
            -v "${BSNG_VERSION}" -y "${BSNG_YEAR}"\
            -o "$(eval_gettext "ext:file|output extension of file")"\
            -o "$(eval_gettext "name:file|output filename without path")"\
            -o "$(eval_gettext "noext:file|output filename without path and extension")"\
            -o "$(eval_gettext "path:file|output path of file")"
    ;;
esac

