Last active
June 19, 2023 12:41
-
-
Save obfusk/9a92037010455a079ee488456b90421b to your computer and use it in GitHub Desktop.
python one-liner to sort version codes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
python3 -c $'import sys\nfor line in sorted(sys.stdin, key=lambda x: [int(n) for n in x[1:].split("-")[0].split(".")]): print(line, end="")' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment