oetiker / rrdtool-1.x

RRDtool 1.x - Round Robin Database
http://www.rrdtool.org
GNU General Public License v2.0
1.01k stars 262 forks source link

man rrdfetch does not report the impact of LANG environment variable #1253

Open jul opened 3 months ago

jul commented 3 months ago

Describe the bug When LANG is set decimal separator of the output of rrd fethc is impacted and it is not documented

To Reproduce

LANG="fr_FR.UTF-8" rrdtool fetch  pierrot.home-ibm_acpi-CPU-g.rrd  AVERAGE | head
                             42

1718179800: 5,3986666667e+01
1718180100: 5,3006666667e+01
1718180400: 5,2006666667e+01
1718180700: 5,0013333333e+01
1718181000: 5,3973333333e+01
1718181300: 5,3006666667e+01
1718181600: 5,1013333333e+01
1718181900: 5,2986666667e+01

Expected behavior If an environment variable changes the behaviour of the output it is better documented in the end of the man pages

#man rrdfetch 2>&1 | tail -n 13 
ENVIRONMENT VARIABLES
       The following environment variables may be used to change the behavior
       of "rrdtool fetch":

       RRDCACHED_ADDRESS
           If this environment variable is set it will have the same effect as
           specifying the "--daemon" option on the command line. If both are
           present, the command line argument takes precedence.
      LANG
          if this environment variable is set decimal separators for numbers are
          set according to your locale preferences

Desktop (please complete the following information):

jul commented 3 months ago

NB : rrdtool export decimal separator does not vary according to LC/LANG environment variable.

As a user I would leave perfectly in peace with LC_ALL=C set authoritatively for rrdtool fetch, I would even be more peaceful than if the caveat was documented.