From 338278551b1f783f956ee80e5478d0bfd912c790 Mon Sep 17 00:00:00 2001 From: goebbe <35854226+goebbe@users.noreply.github.com> Date: Fri, 10 Jan 2025 15:06:17 +0100 Subject: [PATCH 1/3] Update help_cmd.py (#2) Clarify docs: Within a shell, command line options with special characters require adjustments, such as quotation marks. https://github.com/borgbackup/borg/issues/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..40b08e6ed4 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. + Pattern 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 a pattern file is read directly 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 From c9bbddf7441554e69cbdc425fb016e4bc0849dc1 Mon Sep 17 00:00:00 2001 From: goebbe <35854226+goebbe@users.noreply.github.com> Date: Fri, 10 Jan 2025 17:08:52 +0100 Subject: [PATCH 2/3] Update help_cmd.py --- src/borg/archiver/help_cmd.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/borg/archiver/help_cmd.py b/src/borg/archiver/help_cmd.py index 40b08e6ed4..4927c17365 100644 --- a/src/borg/archiver/help_cmd.py +++ b/src/borg/archiver/help_cmd.py @@ -101,14 +101,14 @@ class HelpMixIn: from within a shell, the patterns should be quoted to protect them from expansion. - Pattern matching special characters, e.g. white space, within a shell may + 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 a pattern file is read directly by borg, e.g. when using - ``--exclude-from`` or ``--patterns-from`, there is no shell involved and thus - no quotation marks are required. + 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 From 1cb9c19aeba88e9e015432201c01dde99e6c769e Mon Sep 17 00:00:00 2001 From: goebbe <35854226+goebbe@users.noreply.github.com> Date: Sat, 11 Jan 2025 14:09:42 +0100 Subject: [PATCH 3/3] Update help_cmd.py --- src/borg/archiver/help_cmd.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/borg/archiver/help_cmd.py b/src/borg/archiver/help_cmd.py index 4927c17365..b9f9e15214 100644 --- a/src/borg/archiver/help_cmd.py +++ b/src/borg/archiver/help_cmd.py @@ -107,7 +107,7 @@ class HelpMixIn: 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 + 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