]> git.ipfire.org Git - thirdparty/rrdtool-1.x.git/commitdiff
rrdfirst: fix options documentation and parsing
authorBenoît Monin <benoit.monin@gmx.fr>
Sat, 25 Apr 2015 10:02:44 +0000 (12:02 +0200)
committerBenoît Monin <benoit.monin@gmx.fr>
Sat, 25 Apr 2015 20:54:51 +0000 (22:54 +0200)
* Document short option '-d' for daemon.
* Fix getopt: remove unused '-F' short option.
* Add short-option '-d' to error message.
* Add daemon to rrdtool help.

doc/rrdfirst.pod
src/rrd_first.c
src/rrd_tool.c

index eca21e0452eb692126741a1e7eaac8cfa86533cd..203c6aac6599ba2e76b9d9415f4a62877bfc09ce 100644 (file)
@@ -4,7 +4,7 @@ rrdfirst - Return the date of the first data sample in an RRA within an RRD
 
 =head1 SYNOPSIS
 
-B<rrdtool> B<first> I<filename> [I<--rraindex number>] [B<--daemon> I<address>]
+B<rrdtool> B<first> I<filename> [B<--rraindex> I<number>] [B<--daemon>|B<-d> I<address>]
 
 =head1 DESCRIPTION
 
@@ -17,13 +17,13 @@ sample entered into the specified RRA of the RRD file.
 
 The name of the B<RRD> that contains the data.
 
-=item I<--rraindex number>
+=item B<--rraindex> I<number>
 
 The index number of the B<RRA> that is to be examined. If not specified, the
 index defaults to zero. B<RRA> index numbers can be determined through
 B<rrdtool info>.
 
-=item B<--daemon> I<address>
+=item B<--daemon>|B<-d> I<address>
 
 Address of the L<rrdcached> daemon.  For a list of accepted formats, see 
 the B<-l> option in the L<rrdcached> manual.
index d259ed98b439dbef98cc8555cd0686e4a7038410..5b3dc28b939e6bc01fd7e3b965eacc8b0293d492 100644 (file)
@@ -31,7 +31,7 @@ time_t rrd_first(
         int       option_index = 0;
         int       opt;
 
-        opt = getopt_long(argc, argv, "d:F", long_options, &option_index);
+        opt = getopt_long(argc, argv, "d:", long_options, &option_index);
 
         if (opt == EOF)
             break;
@@ -55,14 +55,14 @@ time_t rrd_first(
             }
             break;
         default:
-            rrd_set_error("usage rrdtool %s [--rraindex number] [--daemon <addr>] file.rrd",
+            rrd_set_error("usage rrdtool %s [--rraindex number] [--daemon|-d <addr>] file.rrd",
                           argv[0]);
             return (-1);
         }
     }
 
     if (optind >= argc) {
-        rrd_set_error("usage rrdtool %s [--rraindex number] [--daemon <addr>] file.rrd",
+        rrd_set_error("usage rrdtool %s [--rraindex number] [--daemon|-d <addr>] file.rrd",
                       argv[0]);
         return -1;
     }
index c39f99034fd23f73d2e6d3e40762a641a7a31237..16bf44d0fd91bf12501e8ee882a091110dd9154f 100644 (file)
@@ -96,7 +96,7 @@ void PrintUsage(
 
     const char *help_first =
         N_("* first - show first update time for RRA within an RRD\n\n"
-           "\trrdtool first filename.rrd [--rraindex number]\n");
+           "\trrdtool first filename.rrd [--rraindex number] [--daemon|-d address]\n");
 
     const char *help_update =
         N_("* update - update an RRD\n\n"