2021-05-01 20:16:51 +00:00
|
|
|
#!/bin/bash -x
|
|
|
|
SOURCE_PATH=${SOURCE_PATH:-../}
|
2018-02-19 14:06:41 +00:00
|
|
|
|
2020-04-22 12:30:54 +00:00
|
|
|
# find all the manual pages in doc/tools
|
2020-05-07 07:13:57 +00:00
|
|
|
TOOLS=`find "${SOURCE_PATH}/doc/tools" -name "*.1.xml" | sed -E -e "s|.*/([a-z0-9-]*).*|\1|" | grep -v goid-tool`
|
2018-02-19 14:06:41 +00:00
|
|
|
ALL=1
|
|
|
|
|
|
|
|
for T in $TOOLS; do
|
2018-05-27 12:04:28 +00:00
|
|
|
SWITCHES=$( ${SOURCE_PATH}/src/tools/${T} --help 2>&1 \
|
|
|
|
| grep -v "unrecognized option '--help'" \
|
|
|
|
| awk '{if (match($0,"--[a-zA-Z0-9-]*",a) != 0) print a[0]}
|
|
|
|
{if (match($0," -[a-zA-Z0-9]",a) != 0) print a[0]}' )
|
|
|
|
|
2018-02-19 14:06:41 +00:00
|
|
|
for S in $SWITCHES; do
|
|
|
|
grep -q -- "$S" ${SOURCE_PATH}/doc/tools/${T}.1.xml || { echo "${T}: missing switch $S"; ALL=0; };
|
|
|
|
done
|
|
|
|
done
|
|
|
|
if [ "$ALL" = 0 ]; then
|
|
|
|
echo "Not all the switches in help are documented in manual pages"
|
2020-04-22 13:01:21 +00:00
|
|
|
exit 1
|
2018-02-19 14:06:41 +00:00
|
|
|
fi
|
2020-04-22 13:01:21 +00:00
|
|
|
|
|
|
|
RES=0
|
|
|
|
# find all tools in src/tools (files without extension)
|
2020-04-22 13:40:48 +00:00
|
|
|
TOOLS=`find "${SOURCE_PATH}/src/tools" -maxdepth 1 -type f ! -name "*.*" | sed -E -e "s|.*/([a-z0-9-]*).*|\1|" | grep -v -- -example`
|
2020-04-22 13:01:21 +00:00
|
|
|
for T in $TOOLS; do
|
|
|
|
if [[ ! -f "${SOURCE_PATH}/doc/tools/$T.1.xml" ]]; then
|
|
|
|
echo "Missing manual page for '$T'"
|
|
|
|
RES=1
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
exit $RES
|