On 2022-06-14 Tu 12:44, Álvaro Herrera wrote:
> The comment atop config_data still mentions $option, but after the patch that's no longer a name used in the
function.(I have to admit that using @_ in the body of the function was a little bit confusing to me at first. Did you
dothat in order to allow multiple options to be passed?)
>
> Also: if you give an option to pg_config, the output is not prefixed with the variable name. So you don't need to
stripthe "SHAREDIR =" bit: there isn't any. This is true even if you give multiple options:
>
> schmee: master 0$ pg_config --sharedir --includedir
> /home/alvherre/Code/pgsql-install/REL9_6_STABLE/share
> /home/alvherre/Code/pgsql-install/REL9_6_STABLE/include
OK, here's a more principled couple of patches. For config_data, if you
give multiple options it gives you back the list of values. If you don't
specify any, in scalar context it just gives you back all of pg_config's
output, but in array context it gives you a map, so you should be able
to say things like:
my %node_config = $node->config_data;
cheers
andrew
--
Andrew Dunstan
EDB: https://www.enterprisedb.com