choco
choco copied to clipboard
(#256) Add `order-by` parameter and sort packages by name by default
This change adds a new command line option "order-by", allowing the user to specify a few sorting strategies. By default the results will be sorted by name.
Fixes #256
Note that some results may appear out-of-order, this is caused by the NuGet server returning them in the incorrect order, see https://github.com/chocolatey/NuGet.Server-chocolatey/issues/2
Minor nitpick, the git commit body (the message) needs to split at 72/80 characters as well.
Minor nitpick, the git commit body (the message) needs to split at 72/80 characters as well.
Do you want 72 or 80?
72 is what CONTRIBUTING states - https://github.com/chocolatey/choco/blob/master/CONTRIBUTING.md#prepare-commits
Wrapped commit body at 72 chars as requested.
Just pushed a change to satisfy AppVeyor. Unfortunately Travis crashed before compilation even started. Anyway, any other changes you require before you decide to merge this pull request?
@ferventcoder I put some effort into this branch 22 to 15 months ago, you requested some changes which I resolved back then, but after that, silence... I can try to rebase this onto current master (or merge master into this branch, which seems reasonable enough to me, you can squash merge anyway), but are you going to try and merge it after I do? The issue is still open so I assume it's still not fixed, but I don't feel like putting effort into this and being neglected again.
Weird. Codacy says there are 2 new issues, but when diving into the details by following the links you end up not seeing them in code. Also, Travis fails with an internal error, I don't think I can fix that. @ferventcoder can you see what's going on?
@bartvanandel Yes, these are good changes. You can rebase or we can manage the rebase for you. I would say ignore Codacy at this point. I think Travis is likely failing here due to the merge conflict as it is trying to build/run it as if it is merged in.
Well, happy to contribute! I think it's probably fastest if you do the rebase, as you know better about what has changed than I do (I basically don't have a clue at this point ;-) and you can merge directly when it's done.
@ferventcoder any progress on this PR?
@ferventcoder hello?
@ferventcoder Are you going to resolve the merge conflicts and merge this branch at some point? This PR is over 2 years old and still applies. I put some effort into it, so it would be nice to see the results in a released version of the product at some point...
BTW I don't think your earlier reviews apply anymore, those were resolved a year and a half ago, but due to rewritten history (as requested, because of the rebase) the commits that were reviewed cannot be found anymore. Basically the review is currently a dead-end street.
@ferventcoder Any chance this PR is ever going to be merged? I just ran choco search screen and I'm still annoyed by the apparent lack of order in the 241 results long output. The PR is now over 2 years old...
BTW I suggest that you take a look at any merge conflicts, I've resolved them in the past but I don't feel like resolving them again only to see the PR still not being merged.
@gep13 Are you the new maintainer? Would you be willing to finish up and merge this long-standing pull request?
I give up. For more than 3 I've tried to get this PR reviewed and merged, but @ferventcoder doesn't seem interested enough.
We will also need to look at deprecating the --order-by-popularity option, as this is essentially duplicated by --order-by="popularity"
We will also need to look at deprecating the
--order-by-popularityoption, as this is essentially duplicated by--order-by="popularity"
Makes sense I guess.
If you don't mind, I won't be making any more changes. This PR is almost 7 years old and was essentially ignored for the past 5 years. I rebased once or twice on request, only to be left out in the cold again.
You're more than welcome to continue working on this branch though.
FWIW, the string "Available in 0.10.12+" is no longer valid either.
@bartvanandel completely understood. Thank you again for getting this PR started, and apologies for the length of time taken.
The wheels turn slowly, but they do turn! 😄
I have taken the liberty to update this PR to be compatible with the latest version of Chocolatey CLI, and rebased/retargeted it against develop.
I have updated the PR again, taking out the aliases and its related EnumExtension helper (I will move this to a different branch so we have a reference to it if needed in the future).
I have also wrapped all error and warning messages on column 80 as we discussed during our chat, and removed the prefixed Warning and Error since we aren't using that elsewhere in the codebase.
Add some more unit tests for the private methods that were added...
@bartvanandel thanks again for getting this PR started, we really appreicate it!
Once the CI builds are complete here, I am going to get this merged, and this will be shipping as part of Chocolatey CLI 2.5.0.
Removing this from the 2.5.0 milestone, since the issue associated with it has been added to the milestone.