def __init__(self, subparser):
    'setup the parser'
    self.rest = None
    repository_parser = subparser.add_parser('repository', help='Manage backup repositories', add_help=False, allow_abbrev=False)
    action_group = repository_parser.add_mutually_exclusive_group(required=True)
    action_group.add_argument('--list', action='store_true', help='Get all repositories')
    action_group.add_argument('--get', action='store_true', help='Get repository by id')
    action_group.add_argument('--archive', action='store_true', help='Archive a repository')
    action_group.add_argument('--add', action='store_true', help='Add a new active repository')
    action_group.add_argument('--remove', action='store_true', help='Remove an archived/imported repository')
    action_group.add_argument('-h', '--help', action=CBHelpAction, klass=self, help='Prints the short or long help message')
    group = repository_parser.add_argument_group('Backup service repository configuration')
    group.add_argument('--id', metavar='<id>', help='The repository id')
    group.add_argument('--new-id', metavar='<id>', help='The new repository id')
    group.add_argument('--state', metavar='<state>', choices=['active', 'archived', 'imported'], help='The repository state.')
    group.add_argument('--plan', metavar='<plan_name>', help='The plan to use as base for the repository')
    group.add_argument('--backup-archive', metavar='<archive>', help='The location to store the backups in')
    group.add_argument('--bucket-name', metavar='<name>', help='The bucket to backup')
    group.add_argument('--remove-data', action='store_true', help='Used to delete the repository data')
    cloud_group = repository_parser.add_argument_group('Backup repository cloud arguments')
    cloud_group.add_argument('--cloud-credentials-name', metavar='<name>', help='The stored clouds credential name to use for the new repository')
    cloud_group.add_argument('--cloud-staging-dir', metavar='<path>', help='The path to the staging directory')
    cloud_group.add_argument('--cloud-credentials-id', metavar='<id>', help='The ID to use to communicate with the object store')
    cloud_group.add_argument('--cloud-credentials-key', metavar='<key>', help='The key to use to communicate with the object store')
    cloud_group.add_argument('--cloud-credentials-region', metavar='<region>', help='The region for the object store')
    cloud_group.add_argument('--cloud-endpoint', metavar='<endpoint>', help='Overrides the default endpoint used to communicate with the cloud provider. Use for object store compatible third party solutions')
    cloud_group.add_argument('--s3-force-path-style', action='store_true', help='When using S3 or S3 compatible storage it will use the old path style.')
setup the parser
def __init__(self, subparser):
    
    self.rest = None
    repository_parser = subparser.add_parser('repository', help='Manage backup repositories', add_help=False, allow_abbrev=False)
    action_group = repository_parser.add_mutually_exclusive_group(required=True)
    action_group.add_argument('--list', action='store_true', help='Get all repositories')
    action_group.add_argument('--get', action='store_true', help='Get repository by id')
    action_group.add_argument('--archive', action='store_true', help='Archive a repository')
    action_group.add_argument('--add', action='store_true', help='Add a new active repository')
    action_group.add_argument('--remove', action='store_true', help='Remove an archived/imported repository')
    action_group.add_argument('-h', '--help', action=CBHelpAction, klass=self, help='Prints the short or long help message')
    group = repository_parser.add_argument_group('Backup service repository configuration')
    group.add_argument('--id', metavar='<id>', help='The repository id')
    group.add_argument('--new-id', metavar='<id>', help='The new repository id')
    group.add_argument('--state', metavar='<state>', choices=['active', 'archived', 'imported'], help='The repository state.')
    group.add_argument('--plan', metavar='<plan_name>', help='The plan to use as base for the repository')
    group.add_argument('--backup-archive', metavar='<archive>', help='The location to store the backups in')
    group.add_argument('--bucket-name', metavar='<name>', help='The bucket to backup')
    group.add_argument('--remove-data', action='store_true', help='Used to delete the repository data')
    cloud_group = repository_parser.add_argument_group('Backup repository cloud arguments')
    cloud_group.add_argument('--cloud-credentials-name', metavar='<name>', help='The stored clouds credential name to use for the new repository')
    cloud_group.add_argument('--cloud-staging-dir', metavar='<path>', help='The path to the staging directory')
    cloud_group.add_argument('--cloud-credentials-id', metavar='<id>', help='The ID to use to communicate with the object store')
    cloud_group.add_argument('--cloud-credentials-key', metavar='<key>', help='The key to use to communicate with the object store')
    cloud_group.add_argument('--cloud-credentials-region', metavar='<region>', help='The region for the object store')
    cloud_group.add_argument('--cloud-endpoint', metavar='<endpoint>', help='Overrides the default endpoint used to communicate with the cloud provider. Use for object store compatible third party solutions')
    cloud_group.add_argument('--s3-force-path-style', action='store_true', help='When using S3 or S3 compatible storage it will use the old path style.')