@@ -62,30 +62,52 @@ for t in \
6262 exit 1
6363 fi
6464 $tool_bin --help > help_string
65+ grep ' ^\\fB\\-' ../doc/man/$tool_name .1 > man_page_opts
6566
6667 # some options are intentionally undocumented
6768 case $tool_name in
6869 cbmc)
69- echo " -all-claims -all-properties -claim -show-claims" >> help_string
70- echo " -document-subgoals" >> help_string
71- echo " -no-propagation -no-simplify -no-simplify-if" >> help_string
72- echo " -floatbv -no-unwinding-assertions" >> help_string
73- echo " -slice-by-trace" >> help_string
70+ for undoc in \
71+ -all-claims -all-properties -claim -show-claims \
72+ -document-subgoals \
73+ -no-propagation -no-simplify -no-simplify-if \
74+ -floatbv -no-unwinding-assertions \
75+ -slice-by-trace ; do
76+ echo " $undoc " >> help_string
77+ echo " $undoc " | sed ' s/^/\\fB/;s/-/\\-/g;s/$/\\fR/' >> man_page_opts
78+ done
7479 ;;
7580 goto-analyzer)
76- echo " -show-intervals -show-non-null" >> help_string
81+ for undoc in -show-intervals -show-non-null ; do
82+ echo " $undoc " >> help_string
83+ echo " $undoc " | sed ' s/^/\\fB/;s/-/\\-/g;s/$/\\fR/' >> man_page_opts
84+ done
7785 ;;
7886 goto-instrument)
79- echo " -document-claims-html -document-claims-latex -show-claims" >> help_string
80- echo " -no-simplify" >> help_string
87+ for undoc in \
88+ -document-claims-html -document-claims-latex -show-claims \
89+ -no-simplify ; do
90+ echo " $undoc " >> help_string
91+ echo " $undoc " | sed ' s/^/\\fB/;s/-/\\-/g;s/$/\\fR/' >> man_page_opts
92+ done
8193 ;;
8294 janalyzer)
83- echo " -show-intervals -show-non-null" >> help_string
95+ # -jar, -gb are documented, but in a different format
96+ for undoc in -show-intervals -show-non-null -jar -gb ; do
97+ echo " $undoc " >> help_string
98+ echo " $undoc " | sed ' s/^/\\fB/;s/-/\\-/g;s/$/\\fR/' >> man_page_opts
99+ done
84100 ;;
85101 jbmc)
86- echo " -document-subgoals" >> help_string
87- echo " -no-propagation -no-simplify -no-simplify-if" >> help_string
88- echo " -no-unwinding-assertions" >> help_string
102+ # -jar, -gb are documented, but in a different format
103+ for undoc in \
104+ -document-subgoals \
105+ -no-propagation -no-simplify -no-simplify-if \
106+ -no-unwinding-assertions \
107+ -jar -gb ; do
108+ echo " $undoc " >> help_string
109+ echo " $undoc " | sed ' s/^/\\fB/;s/-/\\-/g;s/$/\\fR/' >> man_page_opts
110+ done
89111 ;;
90112 esac
91113
@@ -94,8 +116,18 @@ for t in \
94116 echo " Option $opt of $tool_name is undocumented"
95117 missing_options=1
96118 fi
119+ case $opt in
120+ -help|-h|-? ) continue ;;
121+ -version) continue ;;
122+ esac
123+ m_opt=$( echo $opt | sed ' s/-/\\\\-/g' )
124+ if ! grep -q -- " $m_opt " man_page_opts ; then
125+ echo " Option $opt of $tool_name is missing from its man page"
126+ missing_options=1
127+ fi
97128 done
98129 rm help_string
130+ rm man_page_opts
99131done
100132
101133if [ $missing_options -eq 1 ] ; then
0 commit comments