From 83f80419b05d6e1b781cfa55bfce95b57c209129 Mon Sep 17 00:00:00 2001 From: Patrick McDermott Date: Thu, 27 Dec 2018 01:21:24 -0500 Subject: tools/shman.sh: Generate "OPERANDS" sections --- (limited to 'tools') 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() -- cgit v0.9.1