Skip to content
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

feat: add --sort option #42

Merged
merged 5 commits into from
Sep 26, 2022
Merged

feat: add --sort option #42

merged 5 commits into from
Sep 26, 2022

Conversation

lindskogen
Copy link
Contributor

@lindskogen lindskogen commented Sep 2, 2022

Description

This patch adds the --sort option that accepts time-asc, time-desc, diff-asc or diff-desc. And sorts the output by latest targetVersionTime or greatest difference of currentVersionTime and targetVersionTime.

Linked Issues

Fixes #33

Additional context

Sorts the output by the most or least outdated
(decided by targetVersionTime)
src/cli.ts Outdated
type: 'boolean',
describe: 'sort by most outdated',
})
.option('sortReversed', {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of two options, I prefer to have one sort option like:

--sort time-asc
--sort time-desc
--sort diff-asc
--sort diff-desc

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check it again! :)

@lindskogen lindskogen changed the title Add --sort and --sortReversed options Add --sort option Sep 21, 2022
@antfu antfu changed the title Add --sort option feat: add --sort option Sep 26, 2022
@antfu antfu merged commit e35b6cb into antfu-collective:main Sep 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature request] Add options to sort by package's added, latest and outdate date ...etc
2 participants