From 8f1921565bb6cca36fed579acc8b26aea5276f0e Mon Sep 17 00:00:00 2001 From: Landon Curt Noll Date: Sun, 31 Dec 2023 14:08:45 -0800 Subject: [PATCH] further improve readme2index.sh help message The '-p tool' and '-P optstr' will be passed as leading options on the -b tool and -a tool command lines, not to the '-o tool' command lines. Improve help text for readme2index.sh. The `inc/md2html.cfg` file was updated so that the comment about options matches the `readme2index.sh` tool usage message. --- inc/md2html.cfg | 10 +++++----- tmp/readme2index.sh | 24 +++++++++++------------- 2 files changed, 16 insertions(+), 18 deletions(-) diff --git a/inc/md2html.cfg b/inc/md2html.cfg index 2c8442e67..bd280dc76 100644 --- a/inc/md2html.cfg +++ b/inc/md2html.cfg @@ -70,10 +70,10 @@ # # -p tool run 'pandoc wrapper tool' (not pandoc path) during HTML phase number 21 (def: use inc/pandoc_wapper.sh) # -p . skip HTML phase number 21 (def: do nothing during HTML phase number 21) -# NOTE: -p tool will be passed as leading options to other tools (-b, -a, -o). +# NOTE: The '-p tool' will be passed as leading options on the -b tool and -a tool command lines. # -P optstr run 'pandoc wrapper tool' with options found in 'optstr' (def: use only the default options) # NOTE: The 'optstr' may not contain a single-quote, nor a double-quote. -# NOTE: -P optstr will be passed as leading options to other tools (-b, -a, -o). +# NOTE: The '-P optstr' will be passed as leading options on the -b tool and -a tool command lines. # # -a tool run 'after tool' during HTML phase number 20 (def: do not output after pandoc wrapper tool) # -a . skip HTML phase number 22 (def: do nothing during HTML phase number 22) @@ -83,8 +83,8 @@ # -s token=value substitute %%token%% with value except in HTML phase numbers 20-29 (def: do not substitute any tokens) # NOTE: The 'token' string may not contain a ; (semicolon), a = (equal), nor a % (percent). # NOTE: The 'value' string may not contain a ; (semicolon). -# NOTE: A later -s token=value will override an earlier -s token=value for the same 'token'. -# NOTE: Multiple -s token=value are cumulative for the unique set of 'token's. +# NOTE: A later '-s token=value' will override an earlier '-s token=value' for the same 'token'. +# NOTE: Multiple '-s token=value' are cumulative for the unique set of 'token's. # -S failure to replace a %%token%% is not an error (def: exit non-zero for non-substituted tokens) # # -o tool Use output tool, 'tool', to generate option lines (def: do not) @@ -92,7 +92,7 @@ # NOTE: -o may only be used in command_options and md2html.cfg cfg_options (getopt phases 0 and 2) # -O tool=optstr run the 'token replace' named 'tool' with options found in 'optstr' (def: do not add any options) # NOTE: Neither 'tool' nor 'optstr' may not contain an = (equal), a single-quote, nor a double-quote. -# NOTE: A later -O tool=optstr will override all earlier -O tool=optstr for the same 'tool'. +# NOTE: A later '-O tool=optstr' will override all earlier '-O tool=optstr' for the same 'tool'. # NOTE: -O may only be used in command_options and md2html.cfg cfg_options (getopt phases 0 and 2) # # -e string output 'string', followed by newline, to stderr (def: do not) diff --git a/tmp/readme2index.sh b/tmp/readme2index.sh index ed9b699a3..097f6612d 100755 --- a/tmp/readme2index.sh +++ b/tmp/readme2index.sh @@ -88,10 +88,10 @@ export USAGE="usage: $0 [-h] [-v level] [-V] [-n] [-N] -p tool run 'pandoc wrapper tool' (not pandoc path) during HTML phase number 21 (def: use inc/pandoc_wapper.sh) -p . skip HTML phase number 21 (def: do nothing during HTML phase number 21) - NOTE: -p tool will be passed as leading options to other tools (-b, -a, -o). + NOTE: The '-p tool' will be passed as leading options on the -b tool and -a tool command lines. -P optstr run 'pandoc wrapper tool' with options found in 'optstr' (def: use only the default options) NOTE: The 'optstr' may not contain a single-quote, nor a double-quote. - NOTE: -P optstr will be passed as leading options to other tools (-b, -a, -o). + NOTE: The '-P optstr' will be passed as leading options on the -b tool and -a tool command lines. -a tool run 'after tool' during HTML phase number 20 (def: do not output after pandoc wrapper tool) -a . skip HTML phase number 22 (def: do nothing during HTML phase number 22) @@ -101,8 +101,8 @@ export USAGE="usage: $0 [-h] [-v level] [-V] [-n] [-N] -s token=value substitute %%token%% with value except in HTML phase numbers 20-29 (def: do not substitute any tokens) NOTE: The 'token' string may not contain a ; (semicolon), a = (equal), nor a % (percent). NOTE: The 'value' string may not contain a ; (semicolon). - NOTE: A later -s token=value will override an earlier -s token=value for the same 'token'. - NOTE: Multiple -s token=value are cumulative for the unique set of 'token's. + NOTE: A later '-s token=value' will override an earlier '-s token=value' for the same 'token'. + NOTE: Multiple '-s token=value' are cumulative for the unique set of 'token's. -S failure to replace a %%token%% is not an error (def: exit non-zero for non-substituted tokens) -o tool Use output tool, 'tool', to generate option lines (def: do not) @@ -110,7 +110,7 @@ export USAGE="usage: $0 [-h] [-v level] [-V] [-n] [-N] NOTE: -o may only be used in command_options and md2html.cfg cfg_options (getopt phases 0 and 2) -O tool=optstr run the 'token replace' named 'tool' with options found in 'optstr' (def: do not add any options) NOTE: Neither 'tool' nor 'optstr' may not contain an = (equal), a single-quote, nor a double-quote. - NOTE: A later -O tool=optstr will override all earlier -O tool=optstr for the same 'tool'. + NOTE: A later '-O tool=optstr' will override all earlier '-O tool=optstr' for the same 'tool'. NOTE: -O may only be used in command_options and md2html.cfg cfg_options (getopt phases 0 and 2) -e string output 'string', followed by newline, to stderr (def: do not) @@ -937,14 +937,13 @@ for n in "${!OUTPUT_TOOL[@]}"; do # VALUE="${OUTPUT_TOOL[$n]}" if [[ $V_FLAG -ge 7 ]]; then - echo "$0: debug[7]: phase ${GETOPT_PHASE} about to call output tool: $VALUE ${OUTPUT_TOOL_OPTSTR[$VALUE]}" 1>&2 + echo "$0: debug[7]: phase ${GETOPT_PHASE} about to call output tool:" \ + "$VALUE ${OUTPUT_TOOL_OPTSTR[$VALUE]} -- ${WINNER_PATH}" 1>&2 fi # SC2046 (warning): Quote this to prevent word splitting. # SC2086 (info): Double quote to prevent globbing and word splitting. # shellcheck disable=SC2046,SC2086 - OUTPUT_TOOL_OUTPUT=$("$VALUE" -p "${PANDOC_WRAPPER}" -P "${PANDOC_WRAPPER_OPTSTR}" \ - ${OUTPUT_TOOL_OPTSTR[$VALUE]} \ - -- "${WINNER_PATH}") + OUTPUT_TOOL_OUTPUT=$("$VALUE" ${OUTPUT_TOOL_OPTSTR[$VALUE]} -- "${WINNER_PATH}") if [[ $V_FLAG -ge 7 ]]; then echo "$0: debug[7]: phase ${GETOPT_PHASE} output tool output: $OUTPUT_TOOL_OUTPUT" 1>&2 fi @@ -1085,14 +1084,13 @@ for n in "${!OUTPUT_TOOL[@]}"; do # VALUE="${OUTPUT_TOOL[$n]}" if [[ $V_FLAG -ge 7 ]]; then - echo "$0: debug[7]: phase ${GETOPT_PHASE} about to call output tool: $VALUE ${OUTPUT_TOOL_OPTSTR[$VALUE]}" 1>&2 + echo "$0: debug[7]: phase ${GETOPT_PHASE} about to call output tool:" \ + "$VALUE ${OUTPUT_TOOL_OPTSTR[$VALUE]} -- ${WINNER_PATH}" 1>&2 fi # SC2046 (warning): Quote this to prevent word splitting. # SC2086 (info): Double quote to prevent globbing and word splitting. # shellcheck disable=SC2046,SC2086 - OUTPUT_TOOL_OUTPUT=$("$VALUE" -p "${PANDOC_WRAPPER}" -P "${PANDOC_WRAPPER_OPTSTR}" \ - ${OUTPUT_TOOL_OPTSTR[$VALUE]} \ - -- "${WINNER_PATH}") + OUTPUT_TOOL_OUTPUT=$("$VALUE" ${OUTPUT_TOOL_OPTSTR[$VALUE]} -- "${WINNER_PATH}") if [[ $V_FLAG -ge 7 ]]; then echo "$0: debug[7]: phase ${GETOPT_PHASE} output tool output: $OUTPUT_TOOL_OUTPUT" 1>&2 fi