-
Notifications
You must be signed in to change notification settings - Fork 669
Exclusive arguments not allowed in CLI #2769
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Sjord
added a commit
to Sjord/python-gitlab
that referenced
this issue
Jan 21, 2024
The CLI takes its arguments from the RequiredOptional, which has three fields: required, optional, and exclusive. In practice, the exclusive options are not defined as either required or optional, and would not be allowed in the CLI. This changes that, so that exclusive options are also added to the argument parser. Closes python-gitlab#2769
Sjord
added a commit
to Sjord/python-gitlab
that referenced
this issue
Jan 21, 2024
The CLI takes its arguments from the RequiredOptional, which has three fields: required, optional, and exclusive. In practice, the exclusive options are not defined as either required or optional, and would not be allowed in the CLI. This changes that, so that exclusive options are also added to the argument parser. Closes python-gitlab#2769
2 tasks
JohnVillalovos
pushed a commit
to Sjord/python-gitlab
that referenced
this issue
Jan 28, 2024
The CLI takes its arguments from the RequiredOptional, which has three fields: required, optional, and exclusive. In practice, the exclusive options are not defined as either required or optional, and would not be allowed in the CLI. This changes that, so that exclusive options are also added to the argument parser. Closes python-gitlab#2769
JohnVillalovos
pushed a commit
to Sjord/python-gitlab
that referenced
this issue
Jan 29, 2024
The CLI takes its arguments from the RequiredOptional, which has three fields: required, optional, and exclusive. In practice, the exclusive options are not defined as either required or optional, and would not be allowed in the CLI. This changes that, so that exclusive options are also added to the argument parser. Closes python-gitlab#2769
JohnVillalovos
pushed a commit
that referenced
this issue
Jan 29, 2024
* fix(cli): allow exclusive arguments as optional The CLI takes its arguments from the RequiredOptional, which has three fields: required, optional, and exclusive. In practice, the exclusive options are not defined as either required or optional, and would not be allowed in the CLI. This changes that, so that exclusive options are also added to the argument parser. * fix(cli): inform argument parser that options are mutually exclusive * fix(cli): use correct exclusive options, add unit test Closes #2769
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
In gitlab/v4/cli.py, required and optional arguments are added to the argument parser:
Besides required and optional, the RequiredOptional class can also have an exclusive field, and many objects use this to list options not in required or optional. From gitlab/v4/objects/invitations.py:
Here email is an argument defined in exclusive, and not allowed on the CLI:
Issue #2738 describes a similar problem.
The text was updated successfully, but these errors were encountered: