Преглед изворни кода

Merge pull request #3723 from ThomasWaldmann/stdin-filename-1.1

create: implement --stdin-name, fixes #3533 (1.1 backport)
TW пре 7 година
родитељ
комит
2147df91be
1 измењених фајлова са 3 додато и 1 уклоњено
  1. 3 1
      src/borg/archiver.py

+ 3 - 1
src/borg/archiver.py

@@ -485,7 +485,7 @@ class Archiver:
             logger.debug('Processing files ...')
             logger.debug('Processing files ...')
             for path in args.paths:
             for path in args.paths:
                 if path == '-':  # stdin
                 if path == '-':  # stdin
-                    path = 'stdin'
+                    path = args.stdin_name
                     if not dry_run:
                     if not dry_run:
                         try:
                         try:
                             status = archive.process_stdin(path, cache)
                             status = archive.process_stdin(path, cache)
@@ -3138,6 +3138,8 @@ class Archiver:
                                help='experimental: do not synchronize the cache. Implies not using the files cache.')
                                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',
         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')
                                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 = define_exclusion_group(subparser, tag_files=True)
         exclude_group.add_argument('--exclude-nodump', dest='exclude_nodump', action='store_true',
         exclude_group.add_argument('--exclude-nodump', dest='exclude_nodump', action='store_true',