15 Getopt::Long::Configure('pass_through');
16 Getopt::Long::GetOptions(
17 'output=s' => \$output,
18 'version' => \$version,
19 'no-split' => \$no_split,
20 'no-headers' => \$no_headers,
21 'docbook' => \$docbook,
24 'plaintext' => \$plaintext
29 print "makeinfo (OpenWrt stub) 4.13\n";
36 my $path = shift || return;
40 if (open F, "< $path")
42 while (defined(my $line = readline F))
44 if ($line =~ /\@setfilename\s+(\S+)/)
56 $name =~ s!\.[^.]+$!!;
60 $setfile =~ s!\.[^.]+$!! if $setfile;
64 return $setfile ? "$setfile.html" : "$name.html" unless $output;
68 return $setfile ? "$setfile/index.html" : "$name/index.html" unless $output;
69 return "$output/index.html";
71 elsif ($xml || $docbook)
73 $setfile =~ s!\.[^.]+$!! if $setfile;
75 return $setfile ? "$setfile.xml" : "$name.info" unless $output;
80 return ($output || "-");
83 return ($output || $setfile || "$name.info");
86 foreach my $arg (@ARGV)
90 my $out = output_filename($arg);
91 if ($out =~ m!^(.+/)[^/]+$!)
93 system("mkdir", "-p", $1);
97 if ($out ne "-" && !$no_headers)
99 open $fd, "> $out" || die "Can't open $out: $!\n";
102 if ($html || $xml || $docbook)
104 print $fd "<!-- Dummy output for $arg -->\n";
108 print $fd "Dummy output for $arg\n";