2
0
Эх сурвалжийг харах

Merge pull request #3722 from ThomasWaldmann/stdin-filename

create: implement --stdin-name, fixes #3533
TW 7 жил өмнө
parent
commit
5b824f54dd
1 өөрчлөгдсөн 3 нэмэгдсэн , 1 устгасан
  1. 3 1
      src/borg/archiver.py

+ 3 - 1
src/borg/archiver.py

@@ -455,7 +455,7 @@ class Archiver:
                     pass
             for path in args.paths:
                 if path == '-':  # stdin
-                    path = 'stdin'
+                    path = args.stdin_name
                     if not dry_run:
                         try:
                             status = fso.process_stdin(path, cache)
@@ -2940,6 +2940,8 @@ class Archiver:
                                help='experimental: do not synchronize the cache. Implies not using the files cache.')
         subparser.add_argument('--no-files-cache', dest='cache_files', action='store_false',
                                help='do not load/update the file metadata cache used to detect unchanged files')
+        subparser.add_argument('--stdin-name', metavar='NAME', dest='stdin_name', default='stdin',
+                               help='use NAME in archive for stdin data (default: "stdin")')
 
         exclude_group = define_exclusion_group(subparser, tag_files=True)
         exclude_group.add_argument('--exclude-nodump', dest='exclude_nodump', action='store_true',