-
Notifications
You must be signed in to change notification settings - Fork 358
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
Add opam pin remove --all #5308
Conversation
ea85f86
to
b5c3d18
Compare
Yes please! I also have the case that it's difficult to undo an
|
Could you open a new issue to track that problem? |
b5c3d18
to
3ee556f
Compare
All done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tiny tweak to the message.
More importantly, -a
has a lot of different meanings across opam already, so this doesn't technically make things that much worse, however opam remove -a
removes automatically-installed packages but opam pin remove -a
would now mean remove all pins. Might it be worth either using a different letter (opam admin
already has -A
for a --all
option) or just not having a short form at all for this one?
I'm not convinced we need this PR because:
I'd recommend not adding more CLI options to opam when there are existing unix-style solutions that work, and focussing on fixing the really rough edges like 3) above which is hard to do (as you cannot easily probe the set of locally pinned packages without some wildcard magic) |
3ee556f
to
4a8f257
Compare
4a8f257
to
623ee94
Compare
15beb46
to
cab258f
Compare
cab258f
to
6106baf
Compare
@@ -3184,6 +3184,10 @@ let pin ?(unpin_only=false) cli = | |||
changes, and may also be used to keep a package that was removed \ | |||
upstream." | |||
in | |||
let all = | |||
mk_flag ~cli (cli_from cli2_2) ["all"] | |||
"When unpinning, removes all pins in the given switch." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we add a word about this command being a no-op on other pin commands ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I chose to make the use of --all
outside of remove
without any parameter an error instead. Does that work for you?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good for me!
6106baf
to
8a63708
Compare
I often find the need to clean all pins from the current switch i am working on, be it because the pin packages have all been released or other reasons, and listing all the packages or repos one by one can be extremely tedious.