Skip to content

Commit 866334c

Browse files
committed
primitive: Implement Markdown-based help message stub
Signed-off-by: 林博仁(Buo-ren Lin) <[email protected]>
1 parent aee20e9 commit 866334c

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

Source Code/Shell Script(GNU Bash)(primitive).template.bash

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,22 @@ init(){
8585
}; declare -fr init
8686

8787
print_help(){
88-
printf \
89-
'Currently no help messages are available for this program\n' \
90-
1>&2
88+
# Backticks in help message is Markdown's <code> markup
89+
# shellcheck disable=SC2016
90+
{
91+
printf '# Help Information for %s #\n' \
92+
"${RUNTIME_COMMANDLINE_BASECOMMAND}"
93+
printf '## SYNOPSIS ##\n'
94+
printf '* `"%s" _command-line_options_`\n\n' \
95+
"${RUNTIME_COMMANDLINE_BASECOMMAND}"
96+
97+
printf '## COMMAND-LINE OPTIONS ##\n'
98+
printf '### `-h` / `--help` ###\n'
99+
printf 'Print this message\n\n'
100+
101+
printf '### `-d` / `--debug` ###\n'
102+
printf 'Enable script debugging\n\n'
103+
}
91104
return 0
92105
}; declare -fr print_help;
93106

0 commit comments

Comments
 (0)