aboutsummaryrefslogtreecommitdiffstats
path: root/hxtool
diff options
context:
space:
mode:
authorblueswir1 <blueswir1@c046a42c-6fe2-441c-8c8c-71466251a162>2009-03-28 06:44:27 +0000
committerblueswir1 <blueswir1@c046a42c-6fe2-441c-8c8c-71466251a162>2009-03-28 06:44:27 +0000
commit5824d65122347c0dd06074eeb42a51f0643729cb (patch)
tree97a69cf04c3fe47ea91ba0b339a9ee7cb2dbf98f /hxtool
parent649c90780834fedca892e08a27a3dde349e8b98d (diff)
Syncing documentation vs. -help vs. qemu_options table
Try to keep documentation about command line switches, -help text and qemu_options table synchronized. In true Qemu tradition, an include file is generated from single .hx file containing all relevant information in one place. The include file is parsed once for getting the enums, another time for getopt tables and hird time for help messages. Texi documentation for the options is generated from the same .hx file. git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6884 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'hxtool')
-rw-r--r--hxtool42
1 files changed, 42 insertions, 0 deletions
diff --git a/hxtool b/hxtool
new file mode 100644
index 000000000..2c5d77368
--- /dev/null
+++ b/hxtool
@@ -0,0 +1,42 @@
+#!/bin/sh
+
+hxtoh()
+{
+ flag=1
+ while read str; do
+ case $str in
+ HXCOMM*)
+ ;;
+ STEXI*|ETEXI*) flag=$(($flag^1))
+ ;;
+ *)
+ test $flag -eq 1 && echo $str
+ ;;
+ esac
+ done
+}
+
+hxtotexi()
+{
+ flag=0
+ while read str; do
+ case "$str" in
+ HXCOMM*)
+ ;;
+ STEXI*|ETEXI*) flag=$(($flag^1))
+ ;;
+ DEFHEADING*)
+ echo $(expr "$str" : "DEFHEADING(\(.*\))")
+ ;;
+ *)
+ test $flag -eq 1 && echo $str
+ ;;
+ esac
+ done
+}
+
+case "$1" in
+"-h") hxtoh ;;
+"-t") hxtotexi ;;
+*) exit 1 ;;
+esac