- run pygmentize -V (instead of pygmentize -h ) which output a version sentence
- if it fails, it will display the existing pygments.failed
- it parses the sentence:
- if the sentence is empty or don't match the regex /Pygments version (\d(\.\d)+)/, it will display a pygments.invalide
- if the sentence match it will extract the version number:
- if version isn't at least 2.0, it will display a pygments.outdated
- else, it is fine 🌴 🍸
I also modularize the pht to extract pygmentize from the string and make message generalisable and thus translatable.