1
0
Fork 0
mirror of https://github.com/borgbackup/borg.git synced 2024-12-27 02:08:54 +00:00

implement borg debug-info, fixes #1122

In tracebacks we have it already, but with the command,
you can have it without a traceback also.
This commit is contained in:
Thomas Waldmann 2016-08-15 19:20:51 +02:00
parent a0df0a9494
commit e50646a07b

View file

@ -666,6 +666,11 @@ def do_upgrade(self, args):
print("warning: %s" % e) print("warning: %s" % e)
return self.exit_code return self.exit_code
def do_debug_info(self, args):
"""display system information for debugging / bug reports"""
print(sysinfo())
return EXIT_SUCCESS
@with_repository() @with_repository()
def do_debug_dump_archive_items(self, args, repository, manifest, key): def do_debug_dump_archive_items(self, args, repository, manifest, key):
"""dump (decrypted, decompressed) archive items metadata (not: data)""" """dump (decrypted, decompressed) archive items metadata (not: data)"""
@ -1487,6 +1492,18 @@ def build_parser(self, args=None, prog=None):
subparser.add_argument('topic', metavar='TOPIC', type=str, nargs='?', subparser.add_argument('topic', metavar='TOPIC', type=str, nargs='?',
help='additional help on TOPIC') help='additional help on TOPIC')
debug_info_epilog = textwrap.dedent("""
This command displays some system information that might be useful for bug
reports and debugging problems. If a traceback happens, this information is
already appended at the end of the traceback.
""")
subparser = subparsers.add_parser('debug-info', parents=[common_parser],
description=self.do_debug_info.__doc__,
epilog=debug_info_epilog,
formatter_class=argparse.RawDescriptionHelpFormatter,
help='show system infos for debugging / bug reports (debug)')
subparser.set_defaults(func=self.do_debug_info)
debug_dump_archive_items_epilog = textwrap.dedent(""" debug_dump_archive_items_epilog = textwrap.dedent("""
This command dumps raw (but decrypted and decompressed) archive items (only metadata) to files. This command dumps raw (but decrypted and decompressed) archive items (only metadata) to files.
""") """)