Replies: 1 comment
-
|
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
The issue
Today I tried to teach three of my coworkers how to use the
--only-keepoption, and they found the name pretty confusing.The effect of
--only-keepis to remove packages from the working set. On the face of it, "keep" and "remove" are opposites: this is the source of the confusion. "Only keep" suggests that the command only keeps dependencies, and does not add/remove any.Usage examples:
pdm sync --only-keep --prod: This was the example from the original PR for --only-keep. This can be read naturally as "only keep production dependencies."pdm sync --prod --only-keep: With--only-keepafter--prod, the interpretation is unclear.pdm sync --only-keep -d: By analogy with the first example, a user could read this as "only keep dev dependencies", but that is not what the command does, since prod dependencies are also included.pdm sync -G test --only-keep -d: For a user who understandssync,-G, and-d, but is unfamiliar with--only-keep, this command is totally confusing.Behavior of
--only-keepAs far as I understand,
--only-keepdoes both of the following:--cleandoes)pdm sync --only-keepselects all optional and dev dependencies).Is this correct?
Alternative names
Since
--only-keepis similar to--cleanbut does strictly more, I think a related name like--clean-unselectedwould be great. (I think--cleanis well-named: I asked one of my co-workers who has never used--cleanbefore what he expected it to do and he was mostly correct.)Some other ideas:
--deep-clean--clean-extra--remove-unselected--drop-optionalPerhaps we can discuss here and come up with a clearer name?
Beta Was this translation helpful? Give feedback.
All reactions