gtk-doc r636 - trunk



Author: stefkost
Date: Thu Jan  8 09:24:14 2009
New Revision: 636
URL: http://svn.gnome.org/viewvc/gtk-doc?rev=636&view=rev

Log:
	* gtkdoc-check.in:
	* gtkdoc-depscan.in:
	* gtkdoc-fixxref.in:
	* gtkdoc-mkdb.in:
	* gtkdoc-mkhtml.in:
	* gtkdoc-mkman.in:
	* gtkdoc-mktmpl.in:
	* gtkdoc-rebase.in:
	* gtkdoc-scan.in:
	* gtkdoc-scangobj.in:
	* gtkdoc-scanobj.in:
	* gtkdocize.in:
	  Add support for --help and --version to remaining tools. Also show a
	  short info on --help and format more consistently. Fixes #566911



Modified:
   trunk/ChangeLog
   trunk/gtkdoc-check.in
   trunk/gtkdoc-depscan.in
   trunk/gtkdoc-fixxref.in
   trunk/gtkdoc-mkdb.in
   trunk/gtkdoc-mkhtml.in
   trunk/gtkdoc-mkman.in
   trunk/gtkdoc-mktmpl.in
   trunk/gtkdoc-rebase.in
   trunk/gtkdoc-scan.in
   trunk/gtkdoc-scangobj.in
   trunk/gtkdoc-scanobj.in
   trunk/gtkdocize.in

Modified: trunk/gtkdoc-check.in
==============================================================================
--- trunk/gtkdoc-check.in	(original)
+++ trunk/gtkdoc-check.in	Thu Jan  8 09:24:14 2009
@@ -26,6 +26,31 @@
 #		documentations Makefile.am: TESTS = $(GTKDOC_CHECK)
 #############################################################################
 
+use strict;
+use Getopt::Long;
+
+my $PRINT_VERSION;
+my $PRINT_HELP;
+
+my %optctl = ('version' => \$PRINT_VERSION,
+	      'help' => \$PRINT_HELP);
+GetOptions(\%optctl, "version", "help");
+
+if ($PRINT_VERSION) {
+    print "@VERSION \n";
+    exit 0;
+}
+
+if ($PRINT_HELP) {
+    print <<EOF;
+gtkdoc-check version @VERSION@ - run documentation unit tests
+
+--version               Print the version of this program
+--help                  Print this help
+EOF
+    exit 0;
+}
+
 my $DOC_MODULE;
 my $checks = 3;
 

Modified: trunk/gtkdoc-depscan.in
==============================================================================
--- trunk/gtkdoc-depscan.in	(original)
+++ trunk/gtkdoc-depscan.in	Thu Jan  8 09:24:14 2009
@@ -240,7 +240,7 @@
     since      = property(lambda self: self.__since)
 
 def parse_cmdline():
-    options = OptionParser()
+    options = OptionParser(version="@VERSION@")
 
     options.add_option('-b', '--book', dest='books',
                        help='name of a devhelp book to consider',
@@ -278,6 +278,7 @@
 
 if '__main__' == __name__:
     options, args = parse_cmdline()
+
     merge_gnome_path(options)
 
     if not options.books:

Modified: trunk/gtkdoc-fixxref.in
==============================================================================
--- trunk/gtkdoc-fixxref.in	(original)
+++ trunk/gtkdoc-fixxref.in	Thu Jan  8 09:24:14 2009
@@ -53,14 +53,19 @@
 }
 
 if ($PRINT_HELP) {
-    print "gtkdoc-fixxref version @VERSION \n";
-    print "\n--module=MODULE_NAME    Name of the doc module being parsed";
-    print "\n--module-dir=MODULE_DIR The directory which contains the generated HTML";
-    print "\n--html-dir=HTML_DIR     The directory where gtk-doc generated documentation is installed";
-    print "\n--extra-dir=EXTRA_DIR   Directories to recursively scan for indices (index.sgml) in addition to HTML_DIR";
-    print "\n                        May be used more than once for multiple directories";
-    print "\n--version               Print the version of this program";
-    print "\n--help                  Print this help\n";
+        print <<EOF;
+gtkdoc-fixxref version @VERSION@ - fix cross references in html files
+
+--module=MODULE_NAME    Name of the doc module being parsed
+--module-dir=MODULE_DIR The directory which contains the generated HTML
+--html-dir=HTML_DIR     The directory where gtk-doc generated documentation is
+                        installed
+--extra-dir=EXTRA_DIR   Directories to recursively scan for indices (index.sgml)
+                        in addition to HTML_DIR
+                        May be used more than once for multiple directories
+--version               Print the version of this program
+--help                  Print this help
+EOF
     exit 0;
 }
 

Modified: trunk/gtkdoc-mkdb.in
==============================================================================
--- trunk/gtkdoc-mkdb.in	(original)
+++ trunk/gtkdoc-mkdb.in	Thu Jan  8 09:24:14 2009
@@ -94,7 +94,7 @@
 
 if ($PRINT_HELP) {
     print <<EOF;
-gtkdoc-mkdb version @VERSION@
+gtkdoc-mkdb version @VERSION@ - generate docbook files
 
 --module=MODULE_NAME       Name of the doc module being parsed
 --source-dir=DIRNAME       Directories which contain inline reference material

Modified: trunk/gtkdoc-mkhtml.in
==============================================================================
--- trunk/gtkdoc-mkhtml.in	(original)
+++ trunk/gtkdoc-mkhtml.in	Thu Jan  8 09:24:14 2009
@@ -49,6 +49,9 @@
   path_option='--directory'
 fi
 
+# we could do "$path_option $PWD "
+# to avoid needing rewriting entities that are copied from the header
+# into docs under xml
 if test "X$searchpath" = "X"; then
     path_arg=
 else

Modified: trunk/gtkdoc-mkman.in
==============================================================================
--- trunk/gtkdoc-mkman.in	(original)
+++ trunk/gtkdoc-mkman.in	Thu Jan  8 09:24:14 2009
@@ -1,17 +1,63 @@
 #!/bin/sh
 #
 
-prefix= prefix@
-datarootdir= datarootdir@
-gtkdocdir= datadir@/gtk-doc/
-
-if test "x$1" = "x--version"; then
-      echo "@VERSION@"
-      exit 0
-fi
+usage="\
+Usage: gtkdoc-mkman [--path=SEARCH_PATH] MODULE DRIVER_FILE"
+
+# parse options, ignore unknown options for future extensions
 
-for i in `cd sgml;ls *.sgml`
-do j=`echo $i | sed 's/.sgml/.man/'`
-echo ": converting " $i $j
-docbook-to-man sgml/$i > man/$j 2> man/$j.log
+searchpath=
+while true; do
+    case "X$1" in
+        X--version) echo "@VERSION@"; exit 0;;
+        X--help) echo "$usage"; exit 0;;
+        X--path=*) searchpath=`echo $1 | sed s/.*=//`; shift;;
+        X--*) shift;;
+        X*) break;;
+    esac
 done
+
+if test $# -ne 2; then
+      echo "${usage}" 1>&2
+      exit 1
+fi
+
+module=$1
+shift
+document=$1
+shift
+
+# FIXME: this is a hack to run uninstalled
+if test "x$0" = "x prefix@/bin/gtkdoc-mkhtml" ; then
+      #echo "installed"
+      # the first two are needed to resolve datadir
+      prefix= prefix@
+      datarootdir= datarootdir@
+      gtkdocdir= datadir@/gtk-doc/data
+else
+      #echo "uninstalled"
+      gtkdocdir=`dirname $0`
+fi
+
+if head -n 1 $document | grep "<?xml" > /dev/null; then
+  is_xml=true
+else
+  is_xml=false
+fi
+
+# see http://bugzilla.gnome.org/show_bug.cgi?id=467488
+# 
+# XSLTPROC@ --nonet --xinclude \
+#  --stringparam gtkdoc.bookname $module
+#  --stringparam gtkdoc.version"@VERSION@" \
+#  manpages/docbook.xsl $document || exit $?
+
+if $is_xml; then
+else
+  for i in `cd sgml;ls *.sgml` do
+    j=`echo $i | sed 's/.sgml/.man/'`
+    echo ": converting " $i $j
+    docbook-to-man sgml/$i > man/$j 2> man/$j.log
+  done
+fi
+

Modified: trunk/gtkdoc-mktmpl.in
==============================================================================
--- trunk/gtkdoc-mktmpl.in	(original)
+++ trunk/gtkdoc-mktmpl.in	Thu Jan  8 09:24:14 2009
@@ -86,7 +86,7 @@
 
 if ($PRINT_HELP) {
     print <<EOF;
-gtkdoc-mktmpl version @VERSION@
+gtkdoc-mktmpl version @VERSION@ - generate documentation templates
 
 --module=MODULE_NAME Name of the doc module being parsed
 --flag-changes       If specified, changes in templates are flagged

Modified: trunk/gtkdoc-rebase.in
==============================================================================
--- trunk/gtkdoc-rebase.in	(original)
+++ trunk/gtkdoc-rebase.in	Thu Jan  8 09:24:14 2009
@@ -61,19 +61,22 @@
 }
 
 if ($PRINT_HELP) {
-    print "gtkdoc-rebase version @VERSION \n";
-    print "\n--html-dir=HTML_DIR     The directory which contains the installed HTML";
-    print "\n--other-dir=OTHER_DIR   Directories to recursively scan for indices (index.sgml)";
-    print "\n                        May be used more than once for multiple directories";
-    print "\n--online                Prefer cross-references to online documents";
-    print "\n--relative              Prefer relative cross-references";
-    print "\n--aggressive            Rebase links to all files that are under a directory";
-    print "\n                        matching a package name.";
-    print "\n--dest-dir=ROOT_DIR     Staging area virtual root, this prefix will be removed";
-    print "\n                        from HTML_DIR fore relative link calculation.";
-    print "\n--verbose               Be verbose";
-    print "\n--version               Print the version of this program";
-    print "\n--help                  Print this help\n";
+    print <<EOF;
+gtkdoc-rebase version @VERSION@ - rewrite the base url of html files
+
+--html-dir=HTML_DIR     The directory which contains the installed HTML
+--other-dir=OTHER_DIR   Directories to recursively scan for indices (index.sgml)
+                        May be used more than once for multiple directories
+--online                Prefer cross-references to online documents
+--relative              Prefer relative cross-references
+--aggressive            Rebase links to all files that are under a directory
+                        matching a package name.
+--dest-dir=ROOT_DIR     Staging area virtual root, this prefix will be removed
+                        from HTML_DIR fore relative link calculation.
+--verbose               Be verbose
+--version               Print the version of this program
+--help                  Print this help
+EOF
     exit 0;
 }
 

Modified: trunk/gtkdoc-scan.in
==============================================================================
--- trunk/gtkdoc-scan.in	(original)
+++ trunk/gtkdoc-scan.in	Thu Jan  8 09:24:14 2009
@@ -84,17 +84,23 @@
 }
 
 if ($PRINT_HELP) {
-    print "gtkdoc-scan version @VERSION \n";
-    print "\n--module=MODULE_NAME       Name of the doc module being parsed";
-    print "\n--source-dir=DIRNAME       Directories containing the source files to scan";
-    print "\n--ignore-headers=FILES     A space-separated list of header files not to scan";
-    print "\n--output-dir=DIRNAME       The directory where the results are stored";
-    print "\n--deprecated-guards=GUARDS A |-separated list of symbols used as deprecation guards";
-    print "\n--ignore-decorators=DECS   A |-separated list of addition decorators in declarations that should be ignored";
-    print "\n--rebuild-sections         Rebuild (overwrite) the MODULE-sections.txt file";
-    print "\n--rebuild-types            Automatically recreate the MODULE.types file using all the *_get_type() functions found";
-    print "\n--version                  Print the version of this program";
-    print "\n--help                     Print this help\n";
+    print <<EOF;
+gtkdoc-scan version @VERSION@ - scan header files for public symbols
+
+--module=MODULE_NAME       Name of the doc module being parsed
+--source-dir=DIRNAME       Directories containing the source files to scan
+--ignore-headers=FILES     A space-separated list of header files not to scan
+--output-dir=DIRNAME       The directory where the results are stored
+--deprecated-guards=GUARDS A |-separated list of symbols used as deprecation
+                           guards
+--ignore-decorators=DECS   A |-separated list of addition decorators in
+                           declarations that should be ignored
+--rebuild-sections         Rebuild (overwrite) the MODULE-sections.txt file
+--rebuild-types            Automatically recreate the MODULE.types file using
+                           all the *_get_type() functions found
+--version                  Print the version of this program
+--help                     Print this help
+EOF
     exit 0;
 }
 

Modified: trunk/gtkdoc-scangobj.in
==============================================================================
--- trunk/gtkdoc-scangobj.in	(original)
+++ trunk/gtkdoc-scangobj.in	Thu Jan  8 09:24:14 2009
@@ -57,6 +57,7 @@
 
 if ($NO_GTK_INIT) {
   # Do nothing. This just avoids a warning.
+  # the option is not used anymore
 }
 
 if ($PRINT_VERSION) {
@@ -69,15 +70,18 @@
 }
 
 if ($PRINT_HELP) {
-    print "gtkdoc-scangobj version @VERSION \n";
-    print "\n--module=MODULE_NAME  Name of the doc module being parsed";
-    print "\n--types=FILE          The name of the file to store the types in";
-    print "\n--type-init-func=FUNC The init function to call instead of g_type_init ()";
-    print "\n--query-child-properties=FUNC A function that returns a list of child";
-    print "\n                      properties for a class";
-    print "\n--output-dir=DIRNAME  The directory where the results are stored";
-    print "\n--version             Print the version of this program";
-    print "\n--help                Print this help\n";
+    print <<EOF;
+gtkdoc-scangobj version @VERSION@ - introspect g-objects
+
+--module=MODULE_NAME          Name of the doc module being parsed
+--types=FILE                  The name of the file to store the types in
+--type-init-func=FUNC         The init function to call instead of g_type_init()
+--query-child-properties=FUNC A function that returns a list of child
+                              properties for a class
+--output-dir=DIRNAME          The directory where the results are stored
+--version                     Print the version of this program
+--help                        Print this help
+EOF
     exit 0;
 }
 

Modified: trunk/gtkdoc-scanobj.in
==============================================================================
--- trunk/gtkdoc-scanobj.in	(original)
+++ trunk/gtkdoc-scanobj.in	Thu Jan  8 09:24:14 2009
@@ -44,15 +44,33 @@
 	   types => \$TYPES_FILE,
 	   nogtkinit => \$NO_GTK_INIT,
 	   'output-dir' => \$OUTPUT_DIR,
-	   'version' => \$PRINT_VERSION);
+	   'version' => \$PRINT_VERSION,
+	   'help' => \$PRINT_HELP);
 	   
-GetOptions(\%optctl, "module=s", "types:s", "output-dir:s", "nogtkinit", "version");
+GetOptions(\%optctl, "module=s", "types:s", "output-dir:s", "nogtkinit", "version", "help");
 
 if ($PRINT_VERSION) {
     print "@VERSION \n";
     exit 0;
 }
 
+if (!$MODULE) {
+    $PRINT_HELP = 1;
+}
+
+if ($PRINT_HELP) {
+    print <<EOF;
+gtkdoc-scanobj version @VERSION@ - introspect gtk-objects
+
+--module=MODULE_NAME          Name of the doc module being parsed
+--types=FILE                  The name of the file to store the types in
+--output-dir=DIRNAME          The directory where the results are stored
+--version                     Print the version of this program
+--help                        Print this help
+EOF
+    exit 0;
+}
+
 $OUTPUT_DIR = $OUTPUT_DIR ? $OUTPUT_DIR : ".";
 
 $TYPES_FILE = $TYPES_FILE ? $TYPES_FILE : "$OUTPUT_DIR/$MODULE.types";

Modified: trunk/gtkdocize.in
==============================================================================
--- trunk/gtkdocize.in	(original)
+++ trunk/gtkdocize.in	Thu Jan  8 09:24:14 2009
@@ -15,11 +15,15 @@
 copy=no
 makefile=gtk-doc.make
 
+# mini help
+usage="\
+usage: $progname [ --copy ] [ --docdir DIR ] [ --flavour {legacy|no-tmpl} ]"
+
 while test $# -gt 0; do
   case "$1" in
   --help)
-    echo "usage: $progname [ --copy ] [ --docdir DIR ] [ --flavour {legacy|no-tmpl} ]" 1>&2
-    exit 1 ;;
+    echo "$usage"
+    exit 0 ;;
   --version)
     echo "$PROGRAM ($PACKAGE) $VERSION"
     exit 0 ;;
@@ -41,17 +45,17 @@
         ;;
       *)
         echo "$progname: invalid value for --flavour" 1>&2
-        echo "usage: $progname [ --copy ] [ --docdir DIR ] [--flavour {legacy|no-tmpl} ]" 1>&2
+        echo "$usage" 1>&2
         exit 1 ;;
     esac
     shift ;;
   -*)
     echo "$progname: unrecognised option '$1'" 1>&2
-    echo "usage: $progname [ --copy ] [ --docdir DIR ] [--flavour {legacy|no-tmpl} ]" 1>&2
+    echo "$usage" 1>&2
     exit 1 ;;
   *)
     echo "$progname: too many arguments" 1>&2
-    echo "usage: $progname [ --copy ] [ --docdir DIR ] [--flavour {legacy|no-tmpl} ]" 1>&2
+    echo "$usage" 1>&2
     exit 1 ;;
   esac
 done



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]