| 141 | const fail = () => process.exit(1) |
| 142 | |
| 143 | const help = () => console.log( |
| 144 | `SemVer ${version} |
| 145 | |
| 146 | A JavaScript implementation of the https://semver.org/ specification |
| 147 | Copyright Isaac Z. Schlueter |
| 148 | |
| 149 | Usage: semver [options] <version> [<version> [...]] |
| 150 | Prints valid versions sorted by SemVer precedence |
| 151 | |
| 152 | Options: |
| 153 | -r --range <range> |
| 154 | Print versions that match the specified range. |
| 155 | |
| 156 | -i --increment [<level>] |
| 157 | Increment a version by the specified level. Level can |
| 158 | be one of: major, minor, patch, premajor, preminor, |
| 159 | prepatch, prerelease, or release. Default level is 'patch'. |
| 160 | Only one version may be specified. |
| 161 | |
| 162 | --preid <identifier> |
| 163 | Identifier to be used to prefix premajor, preminor, |
| 164 | prepatch or prerelease version increments. |
| 165 | |
| 166 | -l --loose |
| 167 | Interpret versions and ranges loosely |
| 168 | |
| 169 | -p --include-prerelease |
| 170 | Always include prerelease versions in range matching |
| 171 | |
| 172 | -c --coerce |
| 173 | Coerce a string into SemVer if possible |
| 174 | (does not imply --loose) |
| 175 | |
| 176 | --rtl |
| 177 | Coerce version strings right to left |
| 178 | |
| 179 | --ltr |
| 180 | Coerce version strings left to right (default) |
| 181 | |
| 182 | -n <base> |
| 183 | Base number to be used for the prerelease identifier. |
| 184 | Can be either 0 or 1, or false to omit the number altogether. |
| 185 | Defaults to 0. |
| 186 | |
| 187 | Program exits successfully if any valid version satisfies |
| 188 | all supplied ranges, and prints all satisfying versions. |
| 189 | |
| 190 | If no satisfying versions are found, then exits failure. |
| 191 | |
| 192 | Versions are printed in ascending order, so supplying |
| 193 | multiple versions to the utility will just sort them.`) |
| 194 | |
| 195 | main() |