summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick McDermott <patrick.mcdermott@libiquity.com>2018-12-27 01:45:34 (EST)
committer Patrick McDermott <patrick.mcdermott@libiquity.com>2018-12-27 01:45:34 (EST)
commit227d317d68516eff5e7f0a9883439d64b220fa81 (patch)
tree1e89c0c2246ea78cf80e3dc9cd0275af8262d02f
parentdb50df33703b534a68350de6ef68fbd338a68258 (diff)
tools/shman.sh: Add @stdin, @stdout, and @stderr commands
-rw-r--r--tools/shman.sh17
1 files changed, 16 insertions, 1 deletions
diff --git a/tools/shman.sh b/tools/shman.sh
index 9334a49..2084bf7 100644
--- a/tools/shman.sh
+++ b/tools/shman.sh
@@ -85,9 +85,14 @@ gen_doc_func()
local req=
local first_opd=true
local sect_opds=
+ local sect_in=
local sect_ret=
+ local sect_out=
+ local sect_err=
local sect_pure=
+ # TODO: SYNOPSIS
+
sect_name=".SH NAME${LF}${sym}"
while read -r cmd args; do
case "${cmd}" in
@@ -124,9 +129,18 @@ gen_doc_func()
sect_opds="${sect_opds}.TP${LF}.I ${opd}${LF}"
sect_opds="${sect_opds}${desc}${LF}"
;;
+ 'stdin')
+ sect_in=".SH STDIN${LF}${args}"
+ ;;
'return')
sect_ret=".SH RETURN VALUE${LF}${args}"
;;
+ 'stdout')
+ sect_out=".SH STDOUT${LF}${args}"
+ ;;
+ 'stderr')
+ sect_err=".SH STDERR${LF}${args}"
+ ;;
'purity')
sect_pure=".SH SUBSHELL SAFETY AND SIDE EFFECTS"
sect_pure="${sect_pure}${LF}${args}"
@@ -137,7 +151,8 @@ gen_doc_func()
EOF
printf '%s\n\n' "${sect_name}" "${sect_desc}" \
- "${sect_opts}" "${sect_opds}" "${sect_ret}" "${sect_pure}"
+ "${sect_opts}" "${sect_opds}" "${sect_in}" "${sect_ret}" \
+ "${sect_out}" "${sect_err}" "${sect_pure}"
}
gen_doc()