gtkdoc-scan.in patch
- From: Eric Lemings <eric b lemings lmco com>
- To: gtk-doc-list gnome org
- Subject: gtkdoc-scan.in patch
- Date: Thu, 01 Mar 2001 16:31:58 -0700
Added --help and --debug options.
Silence Perl warnings when --module option not given.
Other minor enhancements.
--- gtkdoc-scan.in.orig Thu Mar 1 14:06:05 2001
+++ gtkdoc-scan.in Thu Mar 1 15:18:06 2001
@@ -45,8 +45,8 @@
# Options
# name of documentation module
-my $MODULE;
-my $OUTPUT_DIR;
+my $MODULE = "";
+my $OUTPUT_DIR = ".";
my @SOURCE_DIRS;
my $IGNORE_HEADERS = "";
my $PRINT_VERSION;
@@ -60,9 +60,10 @@
'ignore-headers' => \$IGNORE_HEADERS,
'output-dir' => \$OUTPUT_DIR,
'version' => \$PRINT_VERSION,
+ 'help' => 0, 'debug' => 0,
'deprecated-guards' => \$DEPRECATED_GUARDS);
GetOptions(\%optctl, "module=s", "source-dir:s", "ignore-headers:s",
- "output-dir:s", "version",
+ "output-dir:s", "version", "help|?", "debug",
"deprecated-guards:s");
if ($PRINT_VERSION) {
@@ -70,9 +71,25 @@
exit 0;
}
-$DEPRECATED_GUARDS = $DEPRECATED_GUARDS ? $DEPRECATED_GUARDS : "does_not_match_any_cpp_symbols_at_all_nope";
+if ($optctl{'help'}) {
+ print "Usage: gtkdoc-scan [OPTION ...] [HEADER-FILE ...]\n";
+ print "Scan header files of a module and generate list of identifiers.\n";
+ print "\n";
+ print " --version print version number and exit\n";
+ print " --help print this help message and exit\n";
+ print " --debug print verbose debugging output\n";
+ print "\n";
+ print " --module=NAME name of the module\n";
+ print " --source-dir=TREE scan header files in directory TREE\n";
+ print " --ignore-headers=FILE skip header FILE\n";
+ print " --output-dir=DIR write output files into DIR (default is\n";
+ print " current directory)\n";
+ print " --deprecated-guards=TEXT\n";
+ print " text used to indicate obsolete identifiers\n";
+ exit 0;
+}
-$OUTPUT_DIR = $OUTPUT_DIR ? $OUTPUT_DIR : ".";
+$DEPRECATED_GUARDS = $DEPRECATED_GUARDS ? $DEPRECATED_GUARDS : "does_not_match_any_cpp_symbols_at_all_nope";
if (!-d ${OUTPUT_DIR}) {
mkdir($OUTPUT_DIR, 0755) || die "Cannot create $OUTPUT_DIR: $!";
@@ -122,7 +139,9 @@
sub ScanHeaders {
my ($source_dir, $object_list, $main_list) = @_;
-# print "Scanning source directory: $source_dir\n";
+ if ($optctl{'debug'}) {
+ print "DEBUG: Scanning source directory: $source_dir\n";
+ }
# This array holds any subdirectories found.
my (@subdirs) = ();
@@ -164,7 +183,9 @@
sub ScanHeader {
my ($input_file, $object_list, $main_list) = @_;
-# print "DEBUG: Scanning $input_file\n";
+ if ($optctl{'debug'}) {
+ print "DEBUG: Scanning header file: $input_file\n";
+ }
my $list = ""; # Holds the resulting list of declarations.
my ($in_comment) = 0; # True if we are in a comment.
@@ -199,7 +220,9 @@
# Check if the basename is in the list of headers to ignore.
if ($IGNORE_HEADERS =~ m/(\s|^)\Q${file_basename}\E\.h(\s|$)/) {
-# print "DEBUG: File ignored: $input_file\n";
+ if ($optctl{'debug'}) {
+ print "DEBUG: File ignored: $input_file\n";
+ }
return;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]