Closed rpi-simonz closed 1 month ago
The options -h, --help, --version and -? only work if used as the only option. Otherwise they cause an error:
root@pi54:/backup/pi54# raspiBackup --version -G EN ??? RBK0089E: Unbekannte Option --version. --- RBK0091I: 'raspiBackup.sh -h' liefert eine detailierte Beschreibung aller Scriptaufrufoptionen. --- RBK0026I: Debug Logdatei wurde in /home/chris/raspiBackup.log gesichert. root@pi54:/backup/pi54# raspiBackup --version Version: 0.6.9.1 CommitSHA: 77f6bf8 CommitDate: 2024-06-17 CommitTime: 20:55:53
And option -h is treated specially: It's silently ignored and the backup starts anyway.
-h
Suggestions:
Remove the if (( $# == 1 )) here
if (( $# == 1 ))
# handle options which don't require root access if (( $# == 1 )); then if [[ $1 == "-h" || $1 == "--help" || $1 == "--version" || $1 == "-?" ]]; then
and change this here somehow:
-h|--help) HELP=1; break ;;
to handle the case when -h (and the others from above) is provided as a second or later option. Not allowed...
The options -h, --help, --version and -? only work if used as the only option. Otherwise they cause an error:
And option
-h
is treated specially: It's silently ignored and the backup starts anyway.Suggestions:
Remove the
if (( $# == 1 ))
hereand change this here somehow:
to handle the case when -h (and the others from above) is provided as a second or later option. Not allowed...