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-keep
option, and they found the name pretty confusing.The effect of
--only-keep
is 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-keep
after--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-keep
As far as I understand,
--only-keep
does both of the following:--clean
does)pdm sync --only-keep
selects all optional and dev dependencies).Is this correct?
Alternative names
Since
--only-keep
is similar to--clean
but does strictly more, I think a related name like--clean-unselected
would be great. (I think--clean
is well-named: I asked one of my co-workers who has never used--clean
before what he expected it to do and he was mostly correct.)Some other ideas:
--deep-clean
--clean-extra
--remove-unselected
--drop-optional
Perhaps we can discuss here and come up with a clearer name?
Beta Was this translation helpful? Give feedback.
All reactions