Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: clarify pattern usage with commands #5959

Merged
merged 5 commits into from Aug 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions docs/usage/list.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
...
4 changes: 3 additions & 1 deletion src/borg/archiver.py
Original file line number Diff line number Diff line change
Expand Up @@ -2230,7 +2230,9 @@ def do_break_lock(self, args, repository):
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
Expand Down