fehlerhaftes exit entfernt, hilfe und option -f hinzugefügt

This commit is contained in:
bernd 2021-05-15 23:22:39 +02:00
parent e5df5ee85d
commit 7331d31bcf

View file

@ -399,6 +399,11 @@ proced_ini_line() {
fi
}
display_help() (
echo "Usage: rechnung.sh [-f rechnungsfile] [-h]"
)
quit() {
printf "\n"
printf "%s" "$BLUE"
@ -409,6 +414,16 @@ quit() {
# --- Programmstart --- #
# --------------------- #
# CLI Optionen auswerten
while getopts f:h opt
do
case $opt in
f) RECHNUNGSFILE=$OPTARG;;
h) display_help; exit 0;;
*) display_help; exit 1;;
esac
done
# Verschiedene Basic Checks
if [ -n "$NUMBER_OF_COLORS" ] && [ "$NUMBER_OF_COLORS" -ge 8 ]; then
COLORED_OUTPUT=1
@ -430,9 +445,6 @@ if ! check_sty "$STY_HOME"; then
install_sty
fi
exit
# Kundendatei einlesen und rechnungen erstellen
while IFS= read -r rawline
do