From 6dd7520cc4b3816ae13ec486ce0909b9b881d240 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Fri, 5 Mar 2021 10:44:28 -0800 Subject: Implement environment variable interpolation in defaults files. This allows the syntax `${HOME}` to be used, in fields that expect file paths only. Any environment variable may be interpolated in this way. A warning will be raised for undefined variables. The special variable `USERDATA` is automatically set to the user data directory in force when the defaults file is parsed. (Note: it may be different from the eventual user data directory, if the defaults file or further command line options change that.) Closes #5982. Closes #5977. Closes #6108 (path not taken). --- MANUAL.txt | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'MANUAL.txt') diff --git a/MANUAL.txt b/MANUAL.txt index d97cbcbc9..f06293dd3 100644 --- a/MANUAL.txt +++ b/MANUAL.txt @@ -1672,6 +1672,21 @@ one line: verbosity: INFO ``` +In fields that expect a file path (or list of file paths), the +following syntax may be used to interpolate environment variables: + +``` yaml +csl: ${HOME}/mycsldir/special.csl +``` + +`${USERDATA}` may also be used; this will always resolve to the +user data directory that is current when the defaults file is +parsed, regardless of the setting of the environment +variable `USERDATA`. + +This environment variable interpolation syntax *only* works in +fields that expect file paths. + Default files can be placed in the `defaults` subdirectory of the user data directory and used from any directory. For example, one could create a file specifying defaults for writing -- cgit v1.2.3