|
@@ -1112,7 +1112,15 @@ class Archiver:
|
|
|
subparser.add_argument('location', metavar='REPOSITORY', nargs='?', default='',
|
|
|
type=location_validator(archive=False))
|
|
|
|
|
|
- subparser = subparsers.add_parser('key-export', parents=[common_parser],
|
|
|
+ subparser = subparsers.add_parser('key',
|
|
|
+ description="Manage a keyfile or repokey of a repository",
|
|
|
+ epilog="",
|
|
|
+ formatter_class=argparse.RawDescriptionHelpFormatter,
|
|
|
+ help='manage repository key')
|
|
|
+
|
|
|
+ key_parsers = subparser.add_subparsers(title='required arguments', metavar='<command>')
|
|
|
+
|
|
|
+ subparser = key_parsers.add_parser('export', parents=[common_parser],
|
|
|
description=self.do_key_export.__doc__,
|
|
|
epilog="",
|
|
|
formatter_class=argparse.RawDescriptionHelpFormatter,
|
|
@@ -1126,7 +1134,7 @@ class Archiver:
|
|
|
default=False,
|
|
|
help='Create an export suitable for printing and later type-in')
|
|
|
|
|
|
- subparser = subparsers.add_parser('key-import', parents=[common_parser],
|
|
|
+ subparser = key_parsers.add_parser('import', parents=[common_parser],
|
|
|
description=self.do_key_import.__doc__,
|
|
|
epilog="",
|
|
|
formatter_class=argparse.RawDescriptionHelpFormatter,
|
|
@@ -1579,6 +1587,22 @@ class Archiver:
|
|
|
subparser.add_argument('topic', metavar='TOPIC', type=str, nargs='?',
|
|
|
help='additional help on TOPIC')
|
|
|
|
|
|
+ debug_epilog = textwrap.dedent("""
|
|
|
+ These commands are not intended for normal use and potentially very
|
|
|
+ dangerous if used incorrectly.
|
|
|
+
|
|
|
+ They exist to improve debugging capabilities without direct system access, e.g.
|
|
|
+ in case you ever run into some severe malfunction. Use them only if you know
|
|
|
+ what you are doing or if a trusted developer tells you what to do.""")
|
|
|
+
|
|
|
+ subparser = subparsers.add_parser('debug',
|
|
|
+ description='debugging command (not intended for normal use)',
|
|
|
+ epilog=debug_epilog,
|
|
|
+ formatter_class=argparse.RawDescriptionHelpFormatter,
|
|
|
+ help='debugging command (not intended for normal use)')
|
|
|
+
|
|
|
+ debug_parsers = subparser.add_subparsers(title='required arguments', metavar='<command>')
|
|
|
+
|
|
|
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
|
|
@@ -1591,6 +1615,13 @@ class Archiver:
|
|
|
help='show system infos for debugging / bug reports (debug)')
|
|
|
subparser.set_defaults(func=self.do_debug_info)
|
|
|
|
|
|
+ subparser = debug_parsers.add_parser('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("""
|
|
|
This command dumps raw (but decrypted and decompressed) archive items (only metadata) to files.
|
|
|
""")
|
|
@@ -1604,6 +1635,16 @@ class Archiver:
|
|
|
type=location_validator(archive=True),
|
|
|
help='archive to dump')
|
|
|
|
|
|
+ subparser = debug_parsers.add_parser('dump-archive-items', parents=[common_parser],
|
|
|
+ description=self.do_debug_dump_archive_items.__doc__,
|
|
|
+ epilog=debug_dump_archive_items_epilog,
|
|
|
+ formatter_class=argparse.RawDescriptionHelpFormatter,
|
|
|
+ help='dump archive items (metadata) (debug)')
|
|
|
+ subparser.set_defaults(func=self.do_debug_dump_archive_items)
|
|
|
+ subparser.add_argument('location', metavar='ARCHIVE',
|
|
|
+ type=location_validator(archive=True),
|
|
|
+ help='archive to dump')
|
|
|
+
|
|
|
debug_dump_repo_objs_epilog = textwrap.dedent("""
|
|
|
This command dumps raw (but decrypted and decompressed) repo objects to files.
|
|
|
""")
|
|
@@ -1617,6 +1658,16 @@ class Archiver:
|
|
|
type=location_validator(archive=False),
|
|
|
help='repo to dump')
|
|
|
|
|
|
+ subparser = debug_parsers.add_parser('dump-repo-objs', parents=[common_parser],
|
|
|
+ description=self.do_debug_dump_repo_objs.__doc__,
|
|
|
+ epilog=debug_dump_repo_objs_epilog,
|
|
|
+ formatter_class=argparse.RawDescriptionHelpFormatter,
|
|
|
+ help='dump repo objects (debug)')
|
|
|
+ subparser.set_defaults(func=self.do_debug_dump_repo_objs)
|
|
|
+ subparser.add_argument('location', metavar='REPOSITORY',
|
|
|
+ type=location_validator(archive=False),
|
|
|
+ help='repo to dump')
|
|
|
+
|
|
|
debug_get_obj_epilog = textwrap.dedent("""
|
|
|
This command gets an object from the repository.
|
|
|
""")
|
|
@@ -1634,6 +1685,20 @@ class Archiver:
|
|
|
subparser.add_argument('path', metavar='PATH', type=str,
|
|
|
help='file to write object data into')
|
|
|
|
|
|
+ subparser = debug_parsers.add_parser('get-obj', parents=[common_parser],
|
|
|
+ description=self.do_debug_get_obj.__doc__,
|
|
|
+ epilog=debug_get_obj_epilog,
|
|
|
+ formatter_class=argparse.RawDescriptionHelpFormatter,
|
|
|
+ help='get object from repository (debug)')
|
|
|
+ subparser.set_defaults(func=self.do_debug_get_obj)
|
|
|
+ subparser.add_argument('location', metavar='REPOSITORY', nargs='?', default='',
|
|
|
+ type=location_validator(archive=False),
|
|
|
+ help='repository to use')
|
|
|
+ subparser.add_argument('id', metavar='ID', type=str,
|
|
|
+ help='hex object ID to get from the repo')
|
|
|
+ subparser.add_argument('path', metavar='PATH', type=str,
|
|
|
+ help='file to write object data into')
|
|
|
+
|
|
|
debug_put_obj_epilog = textwrap.dedent("""
|
|
|
This command puts objects into the repository.
|
|
|
""")
|
|
@@ -1649,6 +1714,18 @@ class Archiver:
|
|
|
subparser.add_argument('paths', metavar='PATH', nargs='+', type=str,
|
|
|
help='file(s) to read and create object(s) from')
|
|
|
|
|
|
+ subparser = debug_parsers.add_parser('put-obj', parents=[common_parser],
|
|
|
+ description=self.do_debug_put_obj.__doc__,
|
|
|
+ epilog=debug_put_obj_epilog,
|
|
|
+ formatter_class=argparse.RawDescriptionHelpFormatter,
|
|
|
+ help='put object to repository (debug)')
|
|
|
+ subparser.set_defaults(func=self.do_debug_put_obj)
|
|
|
+ subparser.add_argument('location', metavar='REPOSITORY', nargs='?', default='',
|
|
|
+ type=location_validator(archive=False),
|
|
|
+ help='repository to use')
|
|
|
+ subparser.add_argument('paths', metavar='PATH', nargs='+', type=str,
|
|
|
+ help='file(s) to read and create object(s) from')
|
|
|
+
|
|
|
debug_delete_obj_epilog = textwrap.dedent("""
|
|
|
This command deletes objects from the repository.
|
|
|
""")
|
|
@@ -1663,6 +1740,19 @@ class Archiver:
|
|
|
help='repository to use')
|
|
|
subparser.add_argument('ids', metavar='IDs', nargs='+', type=str,
|
|
|
help='hex object ID(s) to delete from the repo')
|
|
|
+
|
|
|
+ subparser = debug_parsers.add_parser('delete-obj', parents=[common_parser],
|
|
|
+ description=self.do_debug_delete_obj.__doc__,
|
|
|
+ epilog=debug_delete_obj_epilog,
|
|
|
+ formatter_class=argparse.RawDescriptionHelpFormatter,
|
|
|
+ help='delete object from repository (debug)')
|
|
|
+ subparser.set_defaults(func=self.do_debug_delete_obj)
|
|
|
+ subparser.add_argument('location', metavar='REPOSITORY', nargs='?', default='',
|
|
|
+ type=location_validator(archive=False),
|
|
|
+ help='repository to use')
|
|
|
+ subparser.add_argument('ids', metavar='IDs', nargs='+', type=str,
|
|
|
+ help='hex object ID(s) to delete from the repo')
|
|
|
+
|
|
|
return parser
|
|
|
|
|
|
def get_args(self, argv, cmd):
|