mirror of
https://github.com/qemu/qemu.git
synced 2026-07-08 17:56:38 +00:00
hxtool: Error on missing docs
Error if a '.name' is seen after another '.name' without an intervening SRST, this normally indicates missing or misplaced docs. We can't check DEF (as used in command line options) because those often have multiple DEF per doc. Signed-off-by: Dr. David Alan Gilbert <dave@treblig.org> Reviewed-by: Markus Armbruster <armbru@redhat.com> With the two minor tidy ups from Thomas's review Message-ID: <20260504174914.122607-4-dave@treblig.org> Signed-off-by: Markus Armbruster <armbru@redhat.com>
This commit is contained in:
committed by
Markus Armbruster
parent
a048b4e796
commit
675dd677ea
@@ -1,8 +1,15 @@
|
||||
#!/bin/sh
|
||||
|
||||
print_if_not_rst()
|
||||
{
|
||||
test $in_rst -eq 0 && printf "%s\n" "$str"
|
||||
}
|
||||
|
||||
hxtoh()
|
||||
{
|
||||
in_rst=0
|
||||
# .name for HMP
|
||||
seen_name=0
|
||||
while read -r str; do
|
||||
case $str in
|
||||
HXCOMM*)
|
||||
@@ -13,6 +20,8 @@ hxtoh()
|
||||
echo "Error: SRST inside another RST" >&2
|
||||
exit 1
|
||||
fi
|
||||
# consume the name
|
||||
seen_name=0
|
||||
in_rst=1
|
||||
;;
|
||||
ERST*)
|
||||
@@ -23,8 +32,18 @@ hxtoh()
|
||||
fi
|
||||
in_rst=0
|
||||
;;
|
||||
# Note the space at the start - we need to exclude something.name
|
||||
( .name*)
|
||||
if [ $seen_name -eq 1 ]
|
||||
then
|
||||
echo "Error: Seen another .name, maybe missing docs?" >&2
|
||||
exit 1
|
||||
fi
|
||||
seen_name=1
|
||||
print_if_not_rst
|
||||
;;
|
||||
*)
|
||||
test $in_rst -eq 0 && printf "%s\n" "$str"
|
||||
print_if_not_rst
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
Reference in New Issue
Block a user