From 4832364c1d602896c636a5330516a16ef47c4025 Mon Sep 17 00:00:00 2001 From: goebbe <35854226+goebbe@users.noreply.github.com> Date: Sat, 11 Jan 2025 14:37:21 +0100 Subject: [PATCH] docs: clarify requirements when using command line options with special characters within a shell (#8628) docs: within a shell, cli options with special characters may require quoting, #8578 --- src/borg/archiver/help_cmd.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/borg/archiver/help_cmd.py b/src/borg/archiver/help_cmd.py index 5f3b1d0b22..b9f9e15214 100644 --- a/src/borg/archiver/help_cmd.py +++ b/src/borg/archiver/help_cmd.py @@ -101,6 +101,15 @@ class HelpMixIn: from within a shell, the patterns should be quoted to protect them from expansion. + Patterns matching special characters, e.g. white space, within a shell may + require adjustments, such as putting quotation marks around the arguments. + Example: + Using bash, the following command line option would match and exclude "item name": + ``--pattern='-path/item name'`` + Note that when patterns are used within a pattern file directly read by borg, + e.g. when using ``--exclude-from`` or ``--patterns-from``, there is no shell + involved and thus no quotation marks are required. + The ``--exclude-from`` option permits loading exclusion patterns from a text file with one pattern per line. Lines empty or starting with the hash sign '#' after removing whitespace on both ends are ignored. The optional style