From 5a00dc4000d1e9100746613c764f7a76fba8ff89 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Beno=C3=AEt=20Monin?= Date: Sat, 25 Apr 2015 12:02:44 +0200 Subject: [PATCH] rrdlast: fix options documentation and parsing * Document short option '-d' for daemon. * Remove noflush option from documentation, unimplemented * Add short-option '-d' to error message. * Add daemon to rrdtool help. --- doc/rrdlast.pod | 11 ++--------- src/rrd_last.c | 4 ++-- src/rrd_tool.c | 3 ++- 3 files changed, 6 insertions(+), 12 deletions(-) diff --git a/doc/rrdlast.pod b/doc/rrdlast.pod index f0eaad0c..ab9c42a8 100644 --- a/doc/rrdlast.pod +++ b/doc/rrdlast.pod @@ -5,7 +5,7 @@ rrdlast - Return the date of the last data sample in an RRD =head1 SYNOPSIS B B I -S<[B<--daemon> I
]> +S<[B<--daemon>|B<-d> I
]> =head1 DESCRIPTION @@ -18,7 +18,7 @@ update of the RRD. The name of the B that contains the data. -=item B<--daemon> I
+=item B<--daemon>|B<-d> I
Address of the L daemon. If specified, a C command is sent to the server before reading the RRD files. This allows B to return @@ -27,13 +27,6 @@ For a list of accepted formats, see the B<-l> option in the L manual. rrdtool last --daemon unix:/var/run/rrdcached.sock /var/lib/rrd/foo.rrd -=item B<--noflush> - -If the L daemon is being used, then omit the flush normally -send before returning the last update. If you add this option, you get the -last time the file on disk was updated; if you have relatively low cache times -and are calling this frequently it will preserve the caching benefit - =back =head1 ENVIRONMENT VARIABLES diff --git a/src/rrd_last.c b/src/rrd_last.c index 30bece91..dc012a16 100644 --- a/src/rrd_last.c +++ b/src/rrd_last.c @@ -45,7 +45,7 @@ time_t rrd_last( break; default: - rrd_set_error ("Usage: rrdtool %s [--daemon ] ", + rrd_set_error ("Usage: rrdtool %s [--daemon|-d ] ", argv[0]); return (-1); break; @@ -53,7 +53,7 @@ time_t rrd_last( } /* while (42) */ if ((argc - optind) != 1) { - rrd_set_error ("Usage: rrdtool %s [--daemon ] ", + rrd_set_error ("Usage: rrdtool %s [--daemon|-d ] ", argv[0]); return (-1); } diff --git a/src/rrd_tool.c b/src/rrd_tool.c index 74d57f7d..8af96841 100644 --- a/src/rrd_tool.c +++ b/src/rrd_tool.c @@ -88,7 +88,8 @@ void PrintUsage( const char *help_last = N_("* last - show last update time for RRD\n\n" - "\trrdtool last filename.rrd\n"); + "\trrdtool last filename.rrd\n" + "\t\t[--daemon|-d address]\n"); const char *help_lastupdate = N_("* lastupdate - returns the most recent datum stored for\n" -- 2.47.2