Make extension configurable via timewarrior config file
It would be really nice to make extensions configurable via the timewarrior config file, e.g. configuring
ext.myreport.foo = bar
in the config file should yield
myreport.foo: bar
in the extension's input. I would also be fine with
ext.myreport.foo: bar
in the input.
Timewarrior already passes all its configuration to the extension when called.
You can check this by installing the debug.py report that comes with Timewarrior:
$ timew config ext.myreport.foo bar :yes
$ timew show
color = on
confirmation = on
debug = off
ext:
myreport:
foo = bar
... # output shortened for brevity
$ timew debug
color: on
confirmation: on
debug: off
ext.myreport.foo: bar
... # output shortened for brevity
Your report can then extract the value from the line ext.myreport.foo: bar.
I built Timewarrior 1.4.2 from source:
git clone https://github.com/GothenburgBitFactory/timewarrior.git /timewarrior && \ cd /timewarrior && sed -i 's/git.tasktools.org\/TM/github.com\/GothenburgBitFactory/' .gitmodules && \ git submodule init && git submodule update && \ mkdir /build-timewarrior && cd /build-timewarrior && cmake -DCMAKE_BUILD_TYPE=Release /timewarrior && make && make install
I then wrote an extension that prints out the configuration (among other things of course) and the extension does not get the values from taskwarrior.cfg. I can, however, pass values via the command line using e.g. rc.foo=bar.
@AMNeumann, could you install the debug extension that comes with Timewarrior, repeat the commands I stated above and post the output (maybe purge it of private data before)?
$ timew config ext.myreport.foo bar :yes
$ timew show
$ timew debug
This could help debugging the issue.
I then wrote an extension that prints out the configuration (among other things of course) and the extension does not get the values from
taskwarrior.cfg. I can, however, pass values via the command line using e.g.rc.foo=bar.
You have written taskwarrior.cfg instead of timewarrior.cfg. Have you placed your configuration in the correct configuration file?
Note: also discussed in #230 (may be an opportunity to document this usage)