This commit is contained in:
2025-06-16 13:02:22 +02:00
parent 89557b8e36
commit 81a7c96f7f
3 changed files with 25 additions and 6 deletions

View File

@@ -1,17 +1,21 @@
#!/bin/bash
display_help() {
echo "Usage: ${0} [options]"
echo "Options:"
echo " -h, --help Show this help message"
echo " -v, --verbose Enable verbose mode"
echo " -f, --file <file> Specify a file"
echo " -n, --number <num> Specify a number (default: 42)"
}
# Universelle Parameterparser-Funktion
parse_args() {
POSITIONAL=()
while [[ $# -gt 0 ]]; do
case "$1" in
-h|--help)
echo "Usage: $0 [options]"
echo "Options:"
echo " -h, --help Show this help message"
echo " -v, --verbose Enable verbose mode"
echo " -f, --file <file> Specify a file"
echo " -n, --number <num> Specify a number (default: 42)"
display_help "$@"
exit 0
;;
-v|--verbose)