From 678df16bad710d3dbf7f50872683b75402eb2056 Mon Sep 17 00:00:00 2001 From: Thomas Waldmann Date: Fri, 27 Feb 2026 19:33:25 +0100 Subject: [PATCH] add support for auto-generated environment variables (jsonargparse) --- docs/usage/general/environment.rst.inc | 26 ++++++++++++++++++++++++++ src/borg/archiver/__init__.py | 2 ++ 2 files changed, 28 insertions(+) diff --git a/docs/usage/general/environment.rst.inc b/docs/usage/general/environment.rst.inc index 10455252e..d684012ec 100644 --- a/docs/usage/general/environment.rst.inc +++ b/docs/usage/general/environment.rst.inc @@ -284,3 +284,29 @@ Please note: .. _INI: https://docs.python.org/3/library/logging.config.html#configuration-file-format .. _tempfile: https://docs.python.org/3/library/tempfile.html#tempfile.gettempdir + + +Automatically generated Environment Variables (jsonargparse) +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Borg uses jsonargparse_ with ``default_env=True``, which means that every +command-line option can also be set via an environment variable. + +The environment variable name is derived from the program name (``borg``), +the subcommand (if any), and the option name, all converted to uppercase +with dashes replaced by underscores. + +For **top-level options** (not specific to a subcommand), the pattern is:: + + BORG_