docs: clarify pattern usage with commands (#5959)

docs: clarify pattern usage with commands, fixes #5176
This commit is contained in:
remyabel 2021-08-21 10:02:11 -04:00 committed by GitHub
parent c6559f04f0
commit e25095364b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 1 deletions

View File

@ -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
...

View File

@ -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