-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Can we add aliases list
and rm
for ls
and remove
?
#1628
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
I looked into fixing this, but it appears that aliases are intentionally used as recommendations and not meant to actually execute? from src/cli/index.js#L122-L130 if (commandName && typeof aliases[commandName] === 'string') {
const alias = aliases[commandName];
command = {
run(config: Config, reporter: ConsoleReporter | JSONReporter): Promise<void> {
throw new MessageError(`Did you mean \`yarn ${alias}\`?`);
},
};
} Upon further digging through the history, it was changed to an error in commit ef0f9f1 which is part of this PR #439. I'm not sure the reasoning for the changes, but I imagine it wasn't changed by accident. Perhaps @kittens has more insight? Hope this helps some 😄 |
We don't want aliases since it's confusing to have multiple commands that do the same thing. We can either:
|
Since all of the other cli commands look to be complete words, changing |
That sounds reasonable to me, Michael. I’m not sure I understand how aliases are confusing, Sebastian, but I am open to that possibly being true. I imagine a well-designed "yarn help" would designate common aliases as such, though. |
Would really like to see this. TBH I don't agree that it's confusing, I'd venture to say most developers working with yarn are familiar with the concept of aliases. Seems like the usability equivalent of a microoptimization to me, I use |
I would prefer something like And, currently I have a |
PR: #1940 Renamed ls to list, updated the aliases files so ls points to list. |
What about the subcommand options? All of them are |
Inconsistency is now through the roof after #1940 merged in v0.18 release: $ yarn ls
yarn ls v0.18.0
error Did you mean `yarn list`?
$ yarn global list
yarn global v0.18.0
error Invalid subcommand. Try "add, bin, ls, remove, upgrade"
$ yarn config ls
yarn config v0.18.0
error Invalid subcommand. Try "set, get, delete, list"
$ yarn cache list
yarn cache v0.18.0
error Invalid subcommand. Try "ls, dir, clean" |
Aside from the inconsistency, isn't renaming commands a "breaking" API change? Also not that my opinion matters, but I don't see the issue with having multiple commands do the same thing. It's a very common behaviour across all CLI tools after all. Even throwing a warning and just running the command anyway would be more helpful than just saying "did you mean X?" |
@iest in semver prior to 1.0, a minor version bump is for breaking changes - ie, 0.17 to 0.18 is indeed a breaking change. |
Fair enough, ignore me. |
-> Page Not Found |
I'd personally prefer matching with Unix commands: I know you can always alias on your bash profile, I usually do. But there are servers and containers too. |
node -v |
@bestander close The consensus seems to be that we're removing aliases from Yarn. |
Uh oh!
There was an error while loading. Please reload this page.
Do you want to request a feature or report a bug?
Feature
What is the current behavior?
If the current behavior is a bug, please provide the steps to reproduce.
Not a bug per se, but it feels schizo to ask users to use the unix verb in one instance and the human verb in the next.
What is the expected behavior?
Consistency, or better yet, flexibility! 👍
Please mention your node.js, yarn and operating system version.
node 6.9.1 / yarn 0.16.1 / macOS 10.12.1
<3
The text was updated successfully, but these errors were encountered: