diff --git a/rechnung.sh b/rechnung.sh index 5d5f4ca..9e2d830 100755 --- a/rechnung.sh +++ b/rechnung.sh @@ -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