Skip to content

Check completeness of man pages #7169

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions doc/man/goto-instrument.1
Original file line number Diff line number Diff line change
Expand Up @@ -995,6 +995,9 @@ force aggressive slicer to preserve all direct paths
\fB\-\-apply\-loop\-contracts\fR
check and use loop contracts when provided
.TP
\fB\-\-synthesize\-loop\-invariants\fR
synthesize and apply loop invariants
.TP
\fB\-\-replace\-call\-with\-contract\fR \fIfun\fR
replace calls to \fIfun\fR with \fIfun\fR's contract
.TP
Expand Down
56 changes: 44 additions & 12 deletions scripts/check_help.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,30 +62,52 @@ for t in \
exit 1
fi
$tool_bin --help > help_string
grep '^\\fB\\-' ../doc/man/$tool_name.1 > man_page_opts

# some options are intentionally undocumented
case $tool_name in
cbmc)
echo "-all-claims -all-properties -claim -show-claims" >> help_string
echo "-document-subgoals" >> help_string
echo "-no-propagation -no-simplify -no-simplify-if" >> help_string
echo "-floatbv -no-unwinding-assertions" >> help_string
echo "-slice-by-trace" >> help_string
for undoc in \
-all-claims -all-properties -claim -show-claims \
-document-subgoals \
-no-propagation -no-simplify -no-simplify-if \
-floatbv -no-unwinding-assertions \
-slice-by-trace ; do
echo "$undoc" >> help_string
echo "$undoc" | sed 's/^/\\fB/;s/-/\\-/g;s/$/\\fR/' >> man_page_opts
done
;;
goto-analyzer)
echo "-show-intervals -show-non-null" >> help_string
for undoc in -show-intervals -show-non-null ; do
echo "$undoc" >> help_string
echo "$undoc" | sed 's/^/\\fB/;s/-/\\-/g;s/$/\\fR/' >> man_page_opts
done
;;
goto-instrument)
echo "-document-claims-html -document-claims-latex -show-claims" >> help_string
echo "-no-simplify" >> help_string
for undoc in \
-document-claims-html -document-claims-latex -show-claims \
-no-simplify ; do
echo "$undoc" >> help_string
echo "$undoc" | sed 's/^/\\fB/;s/-/\\-/g;s/$/\\fR/' >> man_page_opts
done
;;
janalyzer)
echo "-show-intervals -show-non-null" >> help_string
# -jar, -gb are documented, but in a different format
for undoc in -show-intervals -show-non-null -jar -gb ; do
echo "$undoc" >> help_string
echo "$undoc" | sed 's/^/\\fB/;s/-/\\-/g;s/$/\\fR/' >> man_page_opts
done
;;
jbmc)
echo "-document-subgoals" >> help_string
echo "-no-propagation -no-simplify -no-simplify-if" >> help_string
echo "-no-unwinding-assertions" >> help_string
# -jar, -gb are documented, but in a different format
for undoc in \
-document-subgoals \
-no-propagation -no-simplify -no-simplify-if \
-no-unwinding-assertions \
-jar -gb ; do
echo "$undoc" >> help_string
echo "$undoc" | sed 's/^/\\fB/;s/-/\\-/g;s/$/\\fR/' >> man_page_opts
done
;;
esac

Expand All @@ -94,8 +116,18 @@ for t in \
echo "Option $opt of $tool_name is undocumented"
missing_options=1
fi
case $opt in
-help|-h|-?) continue ;;
-version) continue ;;
esac
m_opt=$(echo $opt | sed 's/-/\\\\-/g')
if ! grep -q -- "$m_opt" man_page_opts ; then
echo "Option $opt of $tool_name is missing from its man page"
missing_options=1
fi
done
rm help_string
rm man_page_opts
done

if [ $missing_options -eq 1 ] ; then
Expand Down