Rename "borgmatic list --pattern-from" flag to "--patterns-from" to match Borg (#230).

This commit is contained in:
Dan Helfman 2019-10-22 22:42:36 -07:00
parent 9ab12e4312
commit fc274b43f0
4 changed files with 5 additions and 4 deletions

1
NEWS
View file

@ -1,6 +1,7 @@
1.3.27.dev0
* #225: Database dump hooks for PostgreSQL, so you can easily dump your databases before backups
run.
* #230: Rename "borgmatic list --pattern-from" flag to "--patterns-from" to match Borg.
1.3.26
* #224: Fix "borgmatic list --successful" with a slightly better heuristic for listing successful

View file

@ -60,8 +60,8 @@ def _write_pattern_file(patterns=None):
def _make_pattern_flags(location_config, pattern_filename=None):
'''
Given a location config dict with a potential pattern_from option, and a filename containing any
additional patterns, return the corresponding Borg flags for those files as a tuple.
Given a location config dict with a potential patterns_from option, and a filename containing
any additional patterns, return the corresponding Borg flags for those files as a tuple.
'''
pattern_filenames = tuple(location_config.get('patterns_from') or ()) + (
(pattern_filename,) if pattern_filename else ()

View file

@ -339,7 +339,7 @@ def parse_arguments(*unparsed_arguments):
)
list_group.add_argument('--pattern', help='Include or exclude paths matching a pattern')
list_group.add_argument(
'--pattern-from',
'--patterns-from',
metavar='FILENAME',
help='Include or exclude paths matching patterns from pattern file, one per line',
)

View file

@ -147,7 +147,7 @@ def test_list_archives_with_short_calls_borg_with_short_parameter():
'exclude',
'exclude_from',
'pattern',
'pattern_from',
'patterns_from',
),
)
def test_list_archives_passes_through_arguments_to_borg(argument_name):