From 1d81e5e3eed88ceb14d6d8d1d20392346b140e69 Mon Sep 17 00:00:00 2001 From: sebu06 Date: Thu, 5 Aug 2021 13:22:17 +0200 Subject: [PATCH] Configuration override of settings for context Every configuration parameter can be overwritten for the current context by setting the parameter: context..rc. = in the config file. This allows for example to set a custom report for each context. --- ChangeLog | 3 +++ doc/man/task.1.in | 5 +++++ doc/man/taskrc.5.in | 10 ++++++++-- src/libshared | 2 +- 4 files changed, 17 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 07ca4bb1a..db9d06815 100644 --- a/ChangeLog +++ b/ChangeLog @@ -81,6 +81,9 @@ Thanks to Sebastian Uharek - #2208 Feature: added coloring of dates with scheduled tasks to calendar Thanks to Sebastian Uharek +- Feature: Configuration options can be overwritten for current + context + Thanks to Sebastian Uharek ------ current release --------------------------- diff --git a/doc/man/task.1.in b/doc/man/task.1.in index 90e92cfce..29a18cdf1 100644 --- a/doc/man/task.1.in +++ b/doc/man/task.1.in @@ -1321,6 +1321,11 @@ the user intention here, and instead, the user is expected to set the Note how read and write contexts differ for context "family", while for context "home" they stay the same. +In addition, every configuration parameter can be overridden for the current +context, by specifying context..rc.. For example, if the default +command for the family context should be displaying the family_report: + + $ task config context.family.rc.default.command family_report .SH COMMAND ABBREVIATION All Taskwarrior commands may be abbreviated as long as a unique prefix is used, diff --git a/doc/man/taskrc.5.in b/doc/man/taskrc.5.in index 3c22e9519..1aca286a8 100644 --- a/doc/man/taskrc.5.in +++ b/doc/man/taskrc.5.in @@ -1481,9 +1481,15 @@ Stores the value of the currently active context. .RE .TP -.B context.= +.B context..= .RS -Stores the definition of the context with the name . +Stores the definition of the context for type with the name . The +type can either be read, write or rc. For details of the read and write types, +please see the task(1) man page. The rc type allows to override any configuration +parameter for the current context, e.g. if the default command for the context +home should be changed to home_report, the following statement could be added: + +context.home.rc.default.command=home_report .RE .SS SYNC diff --git a/src/libshared b/src/libshared index 591fa58f9..fb7e7dcff 160000 --- a/src/libshared +++ b/src/libshared @@ -1 +1 @@ -Subproject commit 591fa58f9c684e22a3a55dbf71bdd00c25ceb28d +Subproject commit fb7e7dcffd397d214f2e71f3ff5de27ac907774f