def _list_collections(self, opts):
    (manifest, errors) = self.rest.get_manifest(opts.bucket)
    _exit_if_errors(errors)
    if (opts.list_collections == ''):
        scope_dict = {}
    else:
        scope_dict = {scope: False for scope in opts.list_collections.split(',')}
    if (opts.output == 'json'):
        self._json_list_collections(manifest, scope_dict)
        return
    for scope in manifest['scopes']:
        if ((len(scope_dict) == 0) or (scope['name'] in scope_dict)):
            if (len(scope_dict) > 0):
                scope_dict[scope['name']] = True
            print(f"Scope {scope['name']}:")
            for collection in scope['collections']:
                print(f"    - {collection['name']}")
    if (len(scope_dict) > 0):
        for (scope, found) in scope_dict.items():
            if (not found):
                _warning(f'Scope "{scope}" does not exist')
def _list_collections(self, opts):
    (manifest, errors) = self.rest.get_manifest(opts.bucket)
    _exit_if_errors(errors)
    if (opts.list_collections == ):
        scope_dict = {}
    else:
        scope_dict = {scope: False for scope in opts.list_collections.split(',')}
    if (opts.output == 'json'):
        self._json_list_collections(manifest, scope_dict)
        return
    for scope in manifest['scopes']:
        if ((len(scope_dict) == 0) or (scope['name'] in scope_dict)):
            if (len(scope_dict) > 0):
                scope_dict[scope['name']] = True
            print(f"Scope {scope['name']}:")
            for collection in scope['collections']:
                print(f"    - {collection['name']}")
    if (len(scope_dict) > 0):
        for (scope, found) in scope_dict.items():
            if (not found):
                _warning(f'Scope "{scope}" does not exist')