timew config

19 views
Skip to first unread message

Thomas Lauf

unread,
Mar 7, 2017, 4:25:21 PM3/7/17
to taskwar...@googlegroups.com
Hi!

I am currently fixing TI-29 (timew config can't add new value) and
during analysis I came upon the following question:

What is the correct behaviour for timewarrior if the user tries to unset
a configuration defined by rules (e.g. reports.week.hours)?

Currently timewarrior exits with 255 and the error message

No entry named 'reports.week.hours' found.

I think this is not quite right, because the value actually does exist.
I would like to alter this by throwing an exception e.g. in
CmdConfig.cpp:256 with a more explanatory message like

Value '{1}' is internally defined and cannot be unset

Comments?

Regards,
Thomas


--
Dr. Thomas Lauf * thoma...@tngtech.com * +49 174 3180 086
TNG Technology Consulting GmbH, Betastr. 13a, 85774 Unterföhring
Geschäftsführer: Henrik Klagges, Christoph Stock, Dr. Robert Dahlke
Sitz: Unterföhring * Amtsgericht München, HRB 135082

signature.asc

Paul Beckingham

unread,
Mar 7, 2017, 4:48:18 PM3/7/17
to taskwar...@googlegroups.com
Hi Thomas,

> What is the correct behaviour for timewarrior if the user tries to unset
> a configuration defined by rules (e.g. reports.week.hours)?

There are built-in defaults for all settings. If there are no defaults for a setting then I have missed it, and it should be created. So I think there are defaults, but it could be that I missed some.

With an empty timewarrior.cfg file, the user should see all the default values in this command:

$ timew config

Any value in the timewarrior.cfg file will override a default. These overrides can be removed, but that just means the user reverts to the default. But using this command, it is possible to unset a value:

$ timew config <name> ‘'

Those are two single quotes. This should result in the timewarrior.cfg entry:

<name>=

This is how a built-in default is effectively “unset”. So the error you specified shouldn’t be needed. I think this indicates that there is no default.

P




> Currently timewarrior exits with 255 and the error message
>
> No entry named 'reports.week.hours' found.
>
> I think this is not quite right, because the value actually does exist.
> I would like to alter this by throwing an exception e.g. in
> CmdConfig.cpp:256 with a more explanatory message like
>
> Value '{1}' is internally defined and cannot be unset
>
> Comments?
>
> Regards,
> Thomas
>
>
> --
> Dr. Thomas Lauf * thoma...@tngtech.com * +49 174 3180 086
> TNG Technology Consulting GmbH, Betastr. 13a, 85774 Unterföhring
> Geschäftsführer: Henrik Klagges, Christoph Stock, Dr. Robert Dahlke
> Sitz: Unterföhring * Amtsgericht München, HRB 135082
>
> --
> You received this message because you are subscribed to the Google Groups "taskwarrior-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to taskwarrior-d...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages