summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 6396ef1)
raw | patch | inline | side by side (parent: 6396ef1)
author | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Fri, 16 May 2008 12:28:37 +0000 (12:28 +0000) | ||
committer | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Fri, 16 May 2008 12:28:37 +0000 (12:28 +0000) |
doc/rrddump.pod | patch | blob | history | |
src/rrd_dump.c | patch | blob | history |
diff --git a/doc/rrddump.pod b/doc/rrddump.pod
index 2e4cd4b2419138bab805a718c130597935a45e4c..a698d841eaa5387580fa9000e0c43020eab8de84 100644 (file)
--- a/doc/rrddump.pod
+++ b/doc/rrddump.pod
=head1 SYNOPSIS
-B<rrdtool> B<dump> I<filename.rrd> E<gt> I<filename.xml>
+B<rrdtool> B<dump> S<[B<--no-header>|B<-n>]> I<filename.rrd> E<gt> I<filename.xml>
or
-B<rrdtool> B<dump> I<filename.rrd> I<filename.xml>
+B<rrdtool> B<dump> S<[B<--no-header>|B<-n>]> I<filename.rrd> I<filename.xml>
=head1 DESCRIPTION
convenient manner.
-
=over 8
=item I<filename.rrd>
The (optional) filename that you want to write the XML output to.
If not specified, the XML will be printed to stdout.
+=item S<[B<--no-header>|B<-n>]>
+
+In rrdtool 1.3, the dump function started producing correct xml-headers.
+Unfortunately the rrdtool restore function from the 1.2 series can not
+handle these headers. With this option you can supress the creatinon of
+the xml headers.
+
=back
=head1 EXAMPLES
diff --git a/src/rrd_dump.c b/src/rrd_dump.c
index 0f69e4f93731efd0e96148311d445cd240537eb7..0feafd72b87e7eca6613ecd0bac30b7d0c4364c7 100644 (file)
--- a/src/rrd_dump.c
+++ b/src/rrd_dump.c
out_file = stdout;
}
- if (opt_noheader){
+ if (!opt_noheader){
fputs("<?xml version=\"1.0\" encoding=\"utf-8\"?>\n", out_file);
fputs
("<!DOCTYPE rrd SYSTEM \"http://oss.oetiker.ch/rrdtool/rrdtool.dtd\">\n",
}
} /* while (42) */
- if ((argc - optind) < 2) {
+ if ((argc - optind) < 1 || (argc - optind) > 2) {
rrd_set_error("usage rrdtool %s [--no-header|-n] "
"file.rrd [file.xml]", argv[0]);
return (-1);
}
- if (argc == 3) {
- rc = rrd_dump_opt_r(argv[1], argv[2],opt_noheader);
+ if ((argc - optind) == 2) {
+ rc = rrd_dump_opt_r(argv[optind], argv[optind+1],opt_noheader);
} else {
- rc = rrd_dump_opt_r(argv[1], NULL,opt_noheader);
+ rc = rrd_dump_opt_r(argv[optind], NULL,opt_noheader);
}
return rc;