print help, when no option is given

This commit is contained in:
Philip Henning 2024-01-18 21:23:12 +01:00
parent 25812b06a3
commit 2ce072c6a4

View file

@ -233,7 +233,7 @@ LONGOPTS=passbase:,file:,help,identity:,key:,output:,path:
# -temporarily store output to be able to check for errors
# -activate quoting/enhanced mode (e.g. by writing out “--options”)
# -pass arguments only via -- "$@" to separate them correctly
! PARSED=$(getopt --options=${OPTIONS} --longoptions=${LONGOPTS} --name "$(basename ${0})" -- "${@}")
! PARSED=$(getopt --options=${OPTIONS} --longoptions=${LONGOPTS} --name "$(basename ${0})" -- "${@:--h}")
if [[ ${PIPESTATUS[0]} -ne 0 ]]; then
# e.g. return value is 1
# then getopt has complained about wrong arguments to stdout