Skip to content

feature: Merge the semver-sort functionality into this repo as a subcommand semver sort ... #41

@justinmchase

Description

@justinmchase

Feature Request

Add the sort subcommand to this cli. It should accept a set of 1 or more versions as inputs and it should return them in a sorted order, one version per line.

The sort algorithm should purely just use the deno std semver library to sort a standard array.

Options

This sort command should support the following options:

  • --asc, -a for ascending sort order (default)
  • --desc, -d for descending sort order
  • -- which should tell the sort command to read the versions from stdin instead of from arguments.

Examples

> semver sort 2.0.0 1.0.0 3.0.0
3.0.0
2.0.0
1.0.0
> semver sort -a 2.0.0 1.0.0 3.0.0
1.0.0
2.0.0
3.0.0
> cat > versions <EOF
2.0.0
1.0.0
3.0.0
EOF

> cat versions | semver sort --
3.0.0
2.0.0
1.0.0

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions