Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Exclusive arguments not allowed in CLI #2769

Closed
@Sjord

Description

@Sjord

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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp