diff --git a/pdfform.sh b/pdfform.sh index 7b2746efd562736f8338933875cb27c902d22d3e..32111a38958a8af47931a12b7706f7da1ca137ee 100644 --- a/pdfform.sh +++ b/pdfform.sh @@ -10,14 +10,29 @@ ## v3 24-01-15 alban: add acceptance for wildcard * ## v4 24-01-17 alban: add file type check ## v5 24-01-23 alban: add binary check +## v6 24-02-08 alban: add direct help option call ## helptext () { - echo "\n Use with one or more files (spaces in file name need quoting or escaping): \n ${0##*/} Example_1.pdf \"Example 2.pdf\" Example\ 3.pdf \n \n Can be used also with wildcard: \n ${0##*/} More_Examples_*.pdf \n\n" + echo "\ + \n\ + This bash script rewrites the already filled in text of PDF forms \n\ + to keep text visible in some viewer's (e.g. okular from KDE) display mode: \n\ + ${0##*/} PDF_1 [... PDF_n] \n\ + or prints this help text again: \n\ + ${0##*/} --help | -h \n\ + \n\ + Use with one or more files (spaces in file name need quoting or escaping): \n\ + ${0##*/} Example_1.pdf \"Example 2.pdf\" Example\ 3.pdf \n\ + \n\ + Can be used also with wildcard: \n\ + ${0##*/} More_Examples_*.pdf \n\ + \n\ + " } -## check for binaries needed +## check for needed binaries ## give needed binaries as space-seperated entries in variable $progs2check ## progs2check="pdftk" @@ -30,7 +45,11 @@ for prog in $progs2check; do done ## help request as parameter -# TBD +case "$1" in + -h|--help) helptext + exit 0 + ;; +esac ## no parameter if [ -z "$1" ]; then @@ -59,5 +78,3 @@ for param in $*; do echo " Result: ${newfilename}" done - -