From e25095364bd9b9d0e1153d74971efcd51868f7f1 Mon Sep 17 00:00:00 2001 From: remyabel <70660631+remyabel@users.noreply.github.com> Date: Sat, 21 Aug 2021 10:02:11 -0400 Subject: [PATCH] docs: clarify pattern usage with commands (#5959) docs: clarify pattern usage with commands, fixes #5176 --- docs/usage/list.rst | 10 ++++++++++ src/borg/archiver.py | 4 +++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/docs/usage/list.rst b/docs/usage/list.rst index f0789edd2..71dfe8eca 100644 --- a/docs/usage/list.rst +++ b/docs/usage/list.rst @@ -31,4 +31,14 @@ Examples drwxrwxr-x user user 0 Sun, 2015-02-01 11:00:00 code drwxrwxr-x user user 0 Sun, 2015-02-01 11:00:00 code/myproject -rw-rw-r-- user user 1416192 Sun, 2015-02-01 11:00:00 code/myproject/file.ext + -rw-rw-r-- user user 1416192 Sun, 2015-02-01 11:00:00 code/myproject/file.text + ... + + $ borg list /path/to/repo/::archiveA --pattern 're:\.ext$' + -rw-rw-r-- user user 1416192 Sun, 2015-02-01 11:00:00 code/myproject/file.ext + ... + + $ borg list /path/to/repo/::archiveA --pattern 're:.ext$' + -rw-rw-r-- user user 1416192 Sun, 2015-02-01 11:00:00 code/myproject/file.ext + -rw-rw-r-- user user 1416192 Sun, 2015-02-01 11:00:00 code/myproject/file.text ... diff --git a/src/borg/archiver.py b/src/borg/archiver.py index 393fe7b83..d1da6533b 100644 --- a/src/borg/archiver.py +++ b/src/borg/archiver.py @@ -2230,7 +2230,9 @@ class Archiver: File patterns support these styles: fnmatch, shell, regular expressions, path prefixes and path full-matches. By default, fnmatch is used for ``--exclude`` patterns and shell-style is used for the experimental - ``--pattern`` option. + ``--pattern`` option. For commands that support patterns in their + ``PATH`` argument like (``borg list``), the default pattern is path + prefix. Starting with Borg 1.2, for all but regular expression pattern matching styles, all paths are treated as relative, meaning that a leading path