From 7331d31bcf4da3462c437361116c26c9ef3fc689 Mon Sep 17 00:00:00 2001 From: bernd Date: Sat, 15 May 2021 23:22:39 +0200 Subject: [PATCH] =?UTF-8?q?fehlerhaftes=20exit=20entfernt,=20hilfe=20und?= =?UTF-8?q?=20option=20-f=20hinzugef=C3=BCgt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- rechnung.sh | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) 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