A Couple Suggestions #4
Labels
bug
Something isn't working
documentation
Improvements or additions to documentation
good first issue
Good for newcomers
I was looking for bash handling of INI files rather than rolling my own and came across this which has some usable ideas.
However I find the returns on some of your functions to be backwards, for example:
ini_section_test returns 0 if the section doesn't exist and 1 if it does, which seems to got totally against posix shell conventions which is zero for true and non-zero for false.
to use your function as part of regular shell operations, the test has to be negated
Which is highly counter intuitive: if not section exists then section exists??
Secondly I'd suggest being able to load the inifile into a global variable and never have to use it again, rather than passing ${ini_data} for every read or test, perhaps adding simple wrappers for the get/list functions that use the preloaded data. Just an idea...
Also generally INI files sections and keys are case-insensitive, not a deal breaker but an item of note.
The text was updated successfully, but these errors were encountered: