Rename "borgmatic list --pattern-from" flag to "--patterns-from" to match Borg (#230).
continuous-integration/drone/push Build is passing Details

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 1.3.27.dev0
* #225: Database dump hooks for PostgreSQL, so you can easily dump your databases before backups * #225: Database dump hooks for PostgreSQL, so you can easily dump your databases before backups
run. run.
* #230: Rename "borgmatic list --pattern-from" flag to "--patterns-from" to match Borg.
1.3.26 1.3.26
* #224: Fix "borgmatic list --successful" with a slightly better heuristic for listing successful * #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): 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 Given a location config dict with a potential patterns_from option, and a filename containing
additional patterns, return the corresponding Borg flags for those files as a tuple. any additional patterns, return the corresponding Borg flags for those files as a tuple.
''' '''
pattern_filenames = tuple(location_config.get('patterns_from') or ()) + ( pattern_filenames = tuple(location_config.get('patterns_from') or ()) + (
(pattern_filename,) if pattern_filename else () (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', help='Include or exclude paths matching a pattern')
list_group.add_argument( list_group.add_argument(
'--pattern-from', '--patterns-from',
metavar='FILENAME', metavar='FILENAME',
help='Include or exclude paths matching patterns from pattern file, one per line', 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',
'exclude_from', 'exclude_from',
'pattern', 'pattern',
'pattern_from', 'patterns_from',
), ),
) )
def test_list_archives_passes_through_arguments_to_borg(argument_name): def test_list_archives_passes_through_arguments_to_borg(argument_name):