Re: Bug#573299: rrdtool: ERROR: unknown option 'M'

Sebastian Harl <[email protected]>
Newsgroups gmane.comp.db.rrdtool.devel
Message-ID <[email protected]>
tags 573299 + patch pending
thanks

Hi,

(This is a follow-up to Debian bug #573299 -- see
<http://bugs.debian.org/573299> for details.)

On Wed, Mar 10, 2010 at 02:17:20PM +0100, Ralf Hildebrandt wrote:
> /usr/bin/rrdtool graph '/usr/share/serverstats/graph/23e14748c7e0282b6acbbc1bd26e1fea.png' -t
> 'CPU usage' -s '-86400' -a 'PNG' -w '500' -h '150' -u '100' -l '0' -M -z
[...]
> results in:
> 
> ERROR: unknown option 'M'
> 
> Yet the man page says:
> 
> # rrdtool help graph |grep M
> [-M|--alt-autoscale-max]
> [COMMENT:text]

Thanks for reporting this!

The attached, trivial patch fixes this issue.

Also, since getopt_long() was told to return `m' to indicate the
``--zoom'' option, I presume that `-m' was supposed to be supported as
well. Thus, I've added support for that as well and documented that in
the rrdgraph(1) manpage.

Tobi, is that fine for you?

Cheers,
Sebastian

-- 
Sebastian "tokkee" Harl +++ GnuPG-ID: 0x8501C7FC +++ http://tokkee.org/

Those who would give up Essential Liberty to purchase a little Temporary
Safety, deserve neither Liberty nor Safety.         -- Benjamin Franklin

_______________________________________________
rrd-developers mailing list
[email protected]
https://lists.oetiker.ch/cgi-bin/listinfo/rrd-developers
bts573299_cl_options.patch (text/x-diff, 1.2 KB)
rrd_graph: Fixed parsing of short command line options.

'M' and 'm' were missing and 'B' and 'b' were specified twice (with
conflicting argument requirement specifications for 'B').

Also, '-m' has been added to the manpage.

Thanks to Ralf Hildebrandt for reporting this as Debian bug #573299!
diff a/program/src/rrd_graph.c b/program/src/rrd_graph.c
--- a/program/src/rrd_graph.c
+++ b/program/src/rrd_graph.c
@@ -4215,7 +4215,7 @@ void rrd_graph_options(
         int       col_start, col_end;
 
         opt = getopt_long(argc, argv,
-                          "Aa:B:b:c:Dd:Ee:Ff:G:gh:IiJjL:l:Nn:Bb:oPR:rS:s:T:t:u:v:W:w:X:x:Yy:z",
+                          "Aa:B:b:c:Dd:Ee:Ff:G:gh:IiJjL:l:Mm:Nn:oPR:rS:s:T:t:u:v:W:w:X:x:Yy:z",
                           long_options, &option_index);
         if (opt == EOF)
             break;
diff a/program/doc/rrdgraph.pod b/program/doc/rrdgraph.pod
--- a/program/doc/rrdgraph.pod
+++ b/program/doc/rrdgraph.pod
@@ -354,7 +354,7 @@ color.
 
 Pick the shape of the color marker next to the label according to the element drawn on the graph.
 
-[B<--zoom> I<factor>]
+[B<-m>|B<--zoom> I<factor>]
 
 Zoom the graphics by the given amount. The factor must be E<gt> 0
signature.asc (application/pgp-signature, 197 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEARECAAYFAkumdUoACgkQEFEKc4UBx/yKeQCfc9wMNLI0bGrOfQknJGGysJWe
bmsAn1IR+KMQtU2dUDjuWHvA4eSFGBtw
=1C6b
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.