summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorPatrick McDermott <patrick.mcdermott@libiquity.com>2018-12-27 01:21:24 (EST)
committer Patrick McDermott <patrick.mcdermott@libiquity.com>2018-12-27 01:21:24 (EST)
commit83f80419b05d6e1b781cfa55bfce95b57c209129 (patch)
treebda8ac92908005784dee7b839bfa970960e435d4 /tools
parent79c7a57807289cdffc30132012f37b59fed54945 (diff)
tools/shman.sh: Generate "OPERANDS" sections
Diffstat (limited to 'tools')
-rw-r--r--tools/shman.sh18
1 files changed, 17 insertions, 1 deletions
diff --git a/tools/shman.sh b/tools/shman.sh
index 5cf9aab..70c202f 100644
--- a/tools/shman.sh
+++ b/tools/shman.sh
@@ -81,6 +81,10 @@ gen_doc_func()
local desc=
local first_opt=true
local sect_opts=
+ local opd=
+ local req=
+ local first_opd=true
+ local sect_opds=
local sect_ret=
sect_name=".SH NAME${LF}${sym}"
@@ -108,6 +112,17 @@ gen_doc_func()
sect_opts="${sect_opts}.TP${LF}${opt}${LF}"
sect_opts="${sect_opts}${desc}${LF}"
;;
+ 'operand')
+ read opd req desc <<-EOF
+ ${args}
+ EOF
+ if ${first_opd}; then
+ sect_opds=".SH OPERANDS${LF}"
+ fi
+ first_opd=false
+ sect_opds="${sect_opds}.TP${LF}.I ${opd}${LF}"
+ sect_opds="${sect_opds}${desc}${LF}"
+ ;;
'return')
sect_ret=".SH RETURN VALUE${LF}${args}"
;;
@@ -116,7 +131,8 @@ gen_doc_func()
${doc}
EOF
- printf '%s\n\n' "${sect_name}" "${sect_desc}" "${sect_opts}" "${sect_ret}"
+ printf '%s\n\n' "${sect_name}" "${sect_desc}" \
+ "${sect_opts}" "${sect_opds}" "${sect_ret}"
}
gen_doc()