1
0
mirror of https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git synced 2026-10-24 00:48:53 +03:00
Files
libgpiod/tools
Bartosz Golaszewski 5a09ebc7ed tools: gpioinfo: don't implicity unquote unnamed lines
Consider the following output of `gpioinfo`:

gpiochip1 - 2 lines:
        line   0:       "foo"                   output
        line   1:       unnamed                 output

Now let's run:

    gpioset --chip=gpiochip1 0=active 1=active

The output of `gpioinfo --unquoted` is correct:

gpiochip1 - 2 lines:
        line   0:       foo                     output consumer=gpioset
        line   1:       unnamed                 output consumer=gpioset

However, without the `unquoted` switch, it's inconsistent:

gpiochip1 - 2 lines:
        line   0:       "foo"                   output consumer="gpioset"
        line   1:       unnamed                 output consumer=gpioset

This is because gpioinfo drops the quotes for all subsequent attribute
strings when it encounters an unnamed line. We should instead keep a
separate instance of the `unquoted` flag just for the line name and pass
the original value of `unquoted_strings` down to
print_line_attributes().

Fixes: 8ffb648928 ("tools: line name focussed rework")
Reviewed-by: Kent Gibson <warthog618@gmail.com>
Link: https://lore.kernel.org/r/20250321-gpioinfo-unnamed-quotes-v1-1-a806e9027adf@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
2025-03-24 10:41:51 +01:00
..
2022-11-21 21:07:45 +01:00
2024-04-24 09:55:36 +02:00
2024-04-24 09:55:36 +02:00
2024-04-24 09:55:36 +02:00
2024-04-24 09:55:36 +02:00
2024-10-03 10:50:15 +02:00