瀏覽代碼

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

Dan Helfman 5 年之前
父節點
當前提交
fc274b43f0
共有 4 個文件被更改,包括 5 次插入4 次删除
  1. 1 0
      NEWS
  2. 2 2
      borgmatic/borg/create.py
  3. 1 1
      borgmatic/commands/arguments.py
  4. 1 1
      tests/unit/borg/test_list.py

+ 1 - 0
NEWS

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

+ 2 - 2
borgmatic/borg/create.py

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

+ 1 - 1
borgmatic/commands/arguments.py

@@ -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',
     )

+ 1 - 1
tests/unit/borg/test_list.py

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