Schniz/fnm

Support for semver ranges when `fnm ls-remote --filter <FILTER>`

40detectives opened this issue · 0 comments

when typing fnm ls-remote --help, it shows:

--filter
Filter versions by a user-defined version or a semver range

In my case I'm tryng to show versions between 20 and 22, tried all the different syntax I saw here https://devhints.io/semver but it seems the support for semver range are somewhat limited:

For example:
fnm ls-remote --filter 20.12.x --> ✅
fnm ls-remote --filter 20.x.x --> ✅
fnm ls-remote --filter 20.x --> ✅
fnm ls-remote --filter 20 --> ✅

fnm ls-remote --filter "~20.12.x" --> ❌ No versions were found
fnm ls-remote --filter "^20.x.x" --> ❌ No versions were found
fnm ls-remote --filter "^20" --> ❌ No versions were found
fnm ls-remote --filter "^20.12.x" --> ❌ No versions were found
fnm ls-remote --filter ">20" --> ❌ No versions were found
fnm ls-remote --filter ">=20" --> ❌ No versions were found
fnm ls-remote --filter "20 - 22" --> ❌ No versions were found
fnm ls-remote --filter ">=20 <22" --> ❌ No versions were found

fnm list-remote --filter "20.x || 22.x" --> ⚠️ Returns the versions corresponding to "20.x", ignores the second part

It seems that right now it is not possible to get a filtered list that is not limited to one major version.