MCPcopy
hub / github.com/borgbackup/borg / build_parser_debug

Method build_parser_debug

src/borg/archiver/debug_cmd.py:309–530  ·  view source on GitHub ↗
(self, subparsers, common_parser, mid_common_parser)

Source from the content-addressed store, hash-verified

307 marshal.dump(msgpack.unpack(rfd, use_list=False, raw=False), wfd)
308
309 def build_parser_debug(self, subparsers, common_parser, mid_common_parser):
310 debug_epilog = process_epilog(
311 """
312 These commands are not intended for normal use and potentially very
313 dangerous if used incorrectly.
314
315 They exist to improve debugging capabilities without direct system access, e.g.
316 in case you ever run into some severe malfunction. Use them only if you know
317 what you are doing or if a trusted developer tells you what to do."""
318 )
319
320 subparser = ArgumentParser(
321 parents=[mid_common_parser],
322 description="debugging command (not intended for normal use)",
323 epilog=debug_epilog,
324 )
325 subparsers.add_subcommand("debug", subparser, help="debugging command (not intended for normal use)")
326
327 debug_parsers = subparser.add_subcommands(required=False, title="required arguments", metavar="<command>")
328
329 debug_info_epilog = process_epilog(
330 """
331 This command displays some system information that might be useful for bug
332 reports and debugging problems. If a traceback happens, this information is
333 already appended at the end of the traceback.
334 """
335 )
336 subparser = ArgumentParser(
337 parents=[mid_common_parser], description=self.do_debug_info.__doc__, epilog=debug_info_epilog
338 )
339 debug_parsers.add_subcommand("info", subparser, help="show system infos for debugging / bug reports (debug)")
340
341 debug_dump_archive_items_epilog = process_epilog(
342 """
343 This command dumps raw (but decrypted and decompressed) archive items (only metadata) to files.
344 """
345 )
346 subparser = ArgumentParser(
347 parents=[mid_common_parser],
348 description=self.do_debug_dump_archive_items.__doc__,
349 epilog=debug_dump_archive_items_epilog,
350 )
351 debug_parsers.add_subcommand("dump-archive-items", subparser, help="dump archive items (metadata) (debug)")
352 subparser.add_argument("name", metavar="NAME", type=archivename_validator, help="specify the archive name")
353
354 debug_dump_archive_epilog = process_epilog(
355 """
356 This command dumps all metadata of an archive in a decoded form to a file.
357 """
358 )
359 subparser = ArgumentParser(
360 parents=[mid_common_parser],
361 description=self.do_debug_dump_archive.__doc__,
362 epilog=debug_dump_archive_epilog,
363 )
364 debug_parsers.add_subcommand("dump-archive", subparser, help="dump decoded archive metadata (debug)")
365 subparser.add_argument("name", metavar="NAME", type=archivename_validator, help="specify the archive name")
366 subparser.add_argument("path", metavar="PATH", type=str, help="file to dump data into")

Callers 1

build_parserMethod · 0.80

Calls 4

process_epilogFunction · 0.85
ArgumentParserClass · 0.85
CompressionSpecClass · 0.85
add_argumentMethod · 0.80

Tested by

no test coverage detected