A small utility to sort semantic(ish) versions.
Versort can be built and installed like so:
cargo build --release
sudo install -vDm755 target/release/versort -t /usr/bin/Assuming versort has been built, tests can be run with:
tests/test.shVersort reads newline-delimited versions from stdin.
git ls-remote --tags --refs https://github.com/tox-wtf/vagrant |
sed 's,.*/,,' | shuf |
versortgit ls-remote --tags --refs https://github.com/python/cpython |
sed -e 's,.*/,,' -e 's,^v,,' | shuf |
versort -i # ignore semvers that couldn't be parsedgit ls-remote --tags --refs https://github.com/tmux/tmux |
sed -e 's,.*/,,' | shuf |
versort -c # treat a single char at the end as a counter