- Notifications
You must be signed in to change notification settings - Fork673
Closed
Description
Ingitlab/v4/cli.py, required and optional arguments are added to the argument parser:
if action_name == "create": for x in mgr_cls._create_attrs.required: sub_parser_action.add_argument( f"--{x.replace('_', '-')}", required=True ) for x in mgr_cls._create_attrs.optional: sub_parser_action.add_argument( f"--{x.replace('_', '-')}", required=False )
Besidesrequired andoptional, the RequiredOptional class can also have anexclusive field, and many objects use this to list options not inrequired oroptional. Fromgitlab/v4/objects/invitations.py:
class ProjectInvitationManager(InvitationMixin, RESTManager): _path = "/projects/{project_id}/invitations" _obj_cls = ProjectInvitation _from_parent_attrs = {"project_id": "id"} _create_attrs = RequiredOptional( required=("access_level",), optional=( "expires_at", "invite_source", "tasks_to_be_done", "tasks_project_id", ), exclusive=("email", "user_id"), )
Hereemail is an argument defined inexclusive, and not allowed on the CLI:
$ python -m gitlab --server-url http://172.16.38.146/ project-invitation create --access-level 10 --email myemail --project-id 1...__main__.py: error: unrecognized arguments: --email myemail
Issue#2738 describes a similar problem.
Metadata
Metadata
Assignees
Labels
No labels