From 87ce00fd0a3022d872bbe58cb28dcf6c10b04bfa Mon Sep 17 00:00:00 2001 From: Landon Curt Noll Date: Fri, 29 Dec 2023 22:55:31 -0800 Subject: [PATCH] update help text for -N With -N, just parse arguments and ignore the file. Change readme2index.sh version from "0.1 2023-12-10" to "0.2 2023-12-29". The previous change in commit d5c4171d73f8d4ef3ad9d3670c47ca398bd9bcbc forgot to update the version number. --- inc/md2html.cfg | 2 +- tmp/readme2index.sh | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/inc/md2html.cfg b/inc/md2html.cfg index fdf600108..f5aea5ed8 100644 --- a/inc/md2html.cfg +++ b/inc/md2html.cfg @@ -48,7 +48,7 @@ # -V print version string and exit # # -n go thru the actions, but do not update any files (def: do the action) -# -N do not process file, just ignore the file (def: process the file) +# -N do not process file, just parse arguments and ignore the file (def: process the file) # # -d topdir set topdir (def: if 'git rev-parse --is-inside-work-tree' is true, then # topdir is output of 'git rev-parse --show-toplevel') diff --git a/tmp/readme2index.sh b/tmp/readme2index.sh index 0139b0b37..88cae1675 100755 --- a/tmp/readme2index.sh +++ b/tmp/readme2index.sh @@ -26,17 +26,19 @@ # # Share and enjoy! :-) -# firewall - bash must be version 4.2 or later +# firewall - must be bash with a version 4.2 or later # # We must declare arrays with -ag or -Ag # -if [[ ${BASH_VERSINFO[0]} -lt 4 || ${BASH_VERSINFO[0]} -eq 4 && ${BASH_VERSINFO[1]} -lt 2 ]]; then +if [[ -z ${BASH_VERSINFO[0]} || ${BASH_VERSINFO[0]} -lt 4 || ${BASH_VERSINFO[0]} -eq 4 && ${BASH_VERSINFO[1]} -lt 2 ]]; then echo "$0: ERROR: bash version must be >= 4.2: $BASH_VERSION" 1>&2 exit 4 fi # setup bash file matching # +# Requires bash with a version 4.2 or later +# shopt -s nullglob # enable expanded to nothing rather than remaining unexpanded shopt -u failglob # disable error message if no matches are found shopt -u dotglob # disable matching files starting with . @@ -47,6 +49,8 @@ shopt -s globstar # enable ** to match all files and zero or more directories an # other required bash options # +# Requires bash with a version 4.2 or later +# shopt -s lastpipe # run last command of a pipeline not executed in the background in the current shell environment # set usage message @@ -62,7 +66,7 @@ export USAGE="usage: $0 [-h] [-v level] [-V] [-n] [-N] -V print version string and exit -n go thru the actions, but do not update any files (def: do the action) - -N do not process file, just ignore the file (def: process the file) + -N do not process file, just parse arguments and ignore the file (def: process the file) -d topdir set topdir (def: if 'git rev-parse --is-inside-work-tree' is true, then topdir is output of 'git rev-parse --show-toplevel') @@ -132,7 +136,7 @@ function global_variable_setup # setup # - export VERSION="0.1 2023-12-10" + export VERSION="0.2 2023-12-29" NAME=$(basename "$0") export NAME #