I need to access a configuration file from a Makefile, and thus seek for a short-readable-maintanable way of doing. The file is a python
ConfigParser compliant file.
#foo.cfg [foo] bar = baz
I use this python oneliner which I found cumbersome
python -c "import ConfigParser; config = ConfigParser.ConfigParser(); config.read('foo.cfg');print config.get('foo','bar')"
Since it is the same format used in git config files, I noticed that
git config -f foo.cfg --get foo.bar might do the job, but (1) my section name got an underscore, which is not supported by
git-config, and (2) it adds an heavy build dependancy for weird and accessory purpose .
I have seen this format used so many time that I think it might exists a better way.
My questions are:
- does this config format get a name ? (which might help for web search)
- is there any standard CLI tools (as simple as
git-config) to read these files?