Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Introducing default cli #4575

Merged
merged 9 commits into from
Mar 19, 2021
Merged

Introducing default cli #4575

merged 9 commits into from
Mar 19, 2021

Conversation

rjbou
Copy link
Collaborator

@rjbou rjbou commented Mar 2, 2021

Some deprecated options need to still be accepted (cf. #4503). The default cli is here to allow them when used with no specified cli (not from environment or from option --cli). Opam prints then a removal warning notice.
The default version is set to 2.0, it will be upgraded at each major release.
Default cli options are ftm opam config deprecated commands.

Example with config var:

$ opam config var prefix
[WARNING] var is deprecated since version 2.1 of the opam CLI, but version 2.1 has been requested. Use opam var instead or set OPAMCLI environment variable to 2.0.
.opam/switch

$ opam config var prefix --cli 2.0
.opam/switch

$ opam config var prefix --cli 2.1
opam: var was removed in version 2.1 of the opam CLI, but version 2.1 has been requested. Use opam var instead or set OPAMCLI environment variable to 2.0.

$ OPAMCLI="2.0" opam config var prefix
.opam/switch

$ OPAMCLI="2.1" opam config var prefix
opam: var was removed in version 2.1 of the opam CLI, but version 2.1 has been requested. Use opam var instead or set OPAMCLI environment variable to 2.0.

@rjbou rjbou added this to the 2.1.0~rc milestone Mar 2, 2021
@rjbou rjbou requested a review from dra27 March 2, 2021 18:38
Copy link
Member

@dra27 dra27 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lovely, thanks! The only changes are the misspelling of previously_str and the deprecation warning can be re-worded. Semantically it's doing exactly what's needed, and I very much like OpamCLIVersion.default. Perhaps it could be automatically the major version of opam?

@rjbou rjbou force-pushed the default-cli branch 2 times, most recently from dcac971 to 71cfb30 Compare March 10, 2021 15:37
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants