eclipse-archived / smarthome

Eclipse SmartHomeâ„¢ project
https://www.eclipse.org/smarthome/
Eclipse Public License 2.0
864 stars 782 forks source link

[core] Feature request: Allow whitespace in addons configuration file #5745

Open kubawolanin opened 6 years ago

kubawolanin commented 6 years ago

Initially I've submitted this issue in https://github.com/openhab/openhab-core/issues/363

Currently the addons.cfg (and other config files located in /services/ folder), require all configuration parameters to be typed inline.

The idea is to replace this:

binding = airquality,astro,chromecast,exec,expire1,http1,kodi,mihome,mqtt1,nest,network,systeminfo,weatherunderground,wol1,yeelight,zwave

With the following structure:

binding =
    airquality,
    astro,
    chromecast,
    exec,
    expire1,
    http1,
    kodi,
    mihome,
    mqtt1,
    nest,
    network,
    systeminfo,
    weatherunderground,
    wol1,
    yeelight,
    zwave

There's a plenty of users keeping as much of the system in the text files as possible 😎 The smart white space handling in the addons file would allow us to keep better maintainable and easier to read files. Plus, our git repositories would be happy too 😆

Cheers

maggu2810 commented 6 years ago

Can you elaborate your suggestion a little bit? How is a multi line value detected? Is it a multi line value if the next line begins with a whitespace? If the lines are concatenated again which whitespace (if it is the marker that the current line is part of the previous one) are removed as they are markers and not part of the value itself, ...

kaikreuzer commented 6 years ago

So far the syntax was chosen along the definition of Java property files. In that sense, I would say that the best option for multi-line support would be the backslash character, i.e. it would be

binding =\
    airquality,\
    astro