Skip to contentSkip to conversation

Use hxtool for qemu-img command list

PATCH Applied Stuart Brady 2 participants 2 messages Jun 6, 2009 – Jun 7, 2009 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Use hxtool for qemu-img command list

Use hxtool to generate the 'command syntax' section of qemu-img's help message, and the corresponding section of the texinfo documentation.

This has the side-effect of adding 'check' to this list of commands in the texinfo documentation.

.gitignore +2 -0
diff -urN qemu-old/.gitignore qemu-new/.gitignore
@@ -19,6 +19,8 @@
 qemu-nbd.8
 qemu-nbd.pod
 qemu-options.texi
+qemu-img-cmds.texi
+qemu-img-cmds.h
 qemu-io
 .gdbinit
 *.a
Makefile +11 -3
diff -urN qemu-old/Makefile qemu-new/Makefile
@@ -238,6 +238,8 @@
 
 ######################################################################
 
+qemu-img.o: qemu-img-cmds.h
+
 qemu-img$(EXESUF): qemu-img.o qemu-tool.o tool-osdep.o $(BLOCK_OBJS)
 
 qemu-nbd$(EXESUF):  qemu-nbd.o qemu-tool.o tool-osdep.o $(BLOCK_OBJS)
@@ -246,6 +248,9 @@
 
 qemu-img$(EXESUF) qemu-nbd$(EXESUF) qemu-io$(EXESUF): LIBS += -lz
 
+qemu-img-cmds.h: $(SRC_PATH)/qemu-img-cmds.hx
+	$(call quiet-command,sh $(SRC_PATH)/hxtool -h < $< > $@,"  GEN   $@")
+
 clean:
 # avoid old build problems by removing potentially incorrect old files
 	rm -f config.mak config.h op-i386.h opc-i386.h gen-op-i386.h op-arm.h opc-arm.h gen-op-arm.h
@@ -257,7 +262,7 @@
         done
 
 distclean: clean
-	rm -f config-host.mak config-host.h $(DOCS) qemu-options.texi
+	rm -f config-host.mak config-host.h $(DOCS) qemu-options.texi qemu-img-cmds.texi
 	rm -f qemu-{doc,tech}.{info,aux,cp,dvi,fn,info,ky,log,pg,toc,tp,vr}
 	for d in $(TARGET_DIRS) libhw32 libhw64; do \
 	rm -rf $$d || exit 1 ; \
@@ -335,13 +340,16 @@
 qemu-monitor.texi: $(SRC_PATH)/qemu-monitor.hx
 	$(call quiet-command,sh $(SRC_PATH)/hxtool -t < $< > $@,"  GEN   $@")
 
+qemu-img-cmds.texi: $(SRC_PATH)/qemu-img-cmds.hx
+	$(call quiet-command,sh $(SRC_PATH)/hxtool -t < $< > $@,"  GEN   $@")
+
 qemu.1: qemu-doc.texi qemu-options.texi qemu-monitor.texi
 	$(call quiet-command, \
 	  perl -Ww -- $(SRC_PATH)/texi2pod.pl $< qemu.pod && \
 	  pod2man --section=1 --center=" " --release=" " qemu.pod > $@, \
 	  "  GEN   $@")
 
-qemu-img.1: qemu-img.texi
+qemu-img.1: qemu-img.texi qemu-img-cmds.texi
 	$(call quiet-command, \
 	  perl -Ww -- $(SRC_PATH)/texi2pod.pl $< qemu-img.pod && \
 	  pod2man --section=1 --center=" " --release=" " qemu-img.pod > $@, \
@@ -359,7 +367,7 @@
 
 html: qemu-doc.html qemu-tech.html
 
-qemu-doc.dvi qemu-doc.html qemu-doc.info: qemu-img.texi qemu-nbd.texi qemu-options.texi qemu-monitor.texi
+qemu-doc.dvi qemu-doc.html qemu-doc.info: qemu-img.texi qemu-nbd.texi qemu-options.texi qemu-monitor.texi qemu-img-cmds.texi
 
 VERSION ?= $(shell cat VERSION)
 FILE = qemu-$(VERSION)
qemu-img.c +39 -28

127 lines not on this page · raw message

qemu-img-cmds.hx +47 -0

47 lines not on this page · raw message

qemu-img.texi +2 -7
diff -urN qemu-old/qemu-img.texi qemu-new/qemu-img.texi
@@ -7,13 +7,8 @@
 @c man begin OPTIONS
 
 The following commands are supported:
-@table @option
-@item create [-F @var{base_fmt}] [-b @var{base_image}] [-f @var{fmt}] [-o @var{options}] @var{filename} [@var{size}]
-@item commit [-f @var{fmt}] @var{filename}
-@item convert [-c] [-f @var{fmt}] [-O @var{output_fmt}] [-o @var{options}] [-B @var{output_base_image}] @var{filename} [@var{filename2} [...]] @var{output_filename}
-@item info [-f @var{fmt}] @var{filename}
-@item snapshot [-l | -a @var{snapshot} | -c @var{snapshot} | -d @var{snapshot}] @var{filename}
-@end table
+
+@include qemu-img-cmds.texi
 
 Command parameters:
 @table @var
Signature · 1 line
Stuart Brady
Applied
#1 lore raw
Quoted 7 lines · Stuart Brady

Use hxtool to generate the 'command syntax' section of qemu-img's help
message, and the corresponding section of the texinfo documentation.

This has the side-effect of adding 'check' to this list of commands in the texinfo documentation.

Thanks, applied.