summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2000-12-14 04:41:45 +0000
committerAndrew Tridgell <tridge@samba.org>2000-12-14 04:41:45 +0000
commitdac34e4b70341dbffeb45d6b565c2589d040c152 (patch)
treee6113f165afbaed6bb6a47f7fb869dfc497588b8 /source4
parentbdb96b0e94b6e742e98d4a5bbf634b433d1ce17c (diff)
downloadsamba-dac34e4b70341dbffeb45d6b565c2589d040c152.tar.gz
samba-dac34e4b70341dbffeb45d6b565c2589d040c152.tar.bz2
samba-dac34e4b70341dbffeb45d6b565c2589d040c152.zip
fixed help
(This used to be commit 649e8ca0bb2af328db62942c146c5f8fc5e71e49)
Diffstat (limited to 'source4')
-rwxr-xr-xsource4/build/pidl/pidl.pl21
1 files changed, 16 insertions, 5 deletions
diff --git a/source4/build/pidl/pidl.pl b/source4/build/pidl/pidl.pl
index 45aec06c02..3af933685c 100755
--- a/source4/build/pidl/pidl.pl
+++ b/source4/build/pidl/pidl.pl
@@ -11,12 +11,14 @@ use Getopt::Long;
use Data::Dumper;
use Parse::RecDescent;
use dump;
+use header;
use util;
my($opt_help) = 0;
my($opt_parse) = 0;
my($opt_dump) = 0;
my($opt_diff) = 0;
+my($opt_header) = 0;
#####################################################################
# parse an IDL file returning a structure containing all the data
@@ -52,8 +54,9 @@ sub ShowHelp()
--help this help page
--parse parse a idl file to a .pidl file
--dump dump a pidl file back to idl
+ --header dump a C header file
--diff run diff on the idl and dumped output
- ";
+ \n";
exit(0);
}
@@ -62,18 +65,20 @@ GetOptions (
'help|h|?' => \$opt_help,
'parse' => \$opt_parse,
'dump' => \$opt_dump,
+ 'header' => \$opt_header,
'diff' => \$opt_diff
);
+if ($opt_help) {
+ ShowHelp();
+ exit(0);
+}
+
my($idl_file) = shift;
die "ERROR: You must specify an idl file to process" unless ($idl_file);
my($pidl_file) = util::ChangeExtension($idl_file, "pidl");
-if ($opt_help) {
- ShowHelp();
-}
-
if ($opt_parse) {
print "Parsing $idl_file\n";
my($idl) = IdlParse($idl_file);
@@ -86,6 +91,12 @@ if ($opt_dump) {
print IdlDump::Dump($idl);
}
+if ($opt_header) {
+ my($idl) = util::LoadStructure($pidl_file);
+ my($header) = util::ChangeExtension($idl_file, "h");
+ util::FileSave($header, IdlHeader::Dump($idl));
+}
+
if ($opt_diff) {
my($idl) = util::LoadStructure($pidl_file);
my($tempfile) = util::ChangeExtension($idl_file, "tmp");