File tree Expand file tree Collapse file tree 2 files changed +15
-0
lines changed
Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,7 @@ New Features:
3636 prepended to (e.g. *note title paragraph *).
3737* Support interlaced PNG images (#274). Note that this can slow down rendering
3838 significantly for many/large interlaced images.
39+ * rinoh now accepts the ``--versions `` argument, useful for bug reports
3940
4041Changed:
4142
Original file line number Diff line number Diff line change 88
99import argparse
1010import os
11+ import sys
1112import webbrowser
1213
1314from collections import OrderedDict
15+ from contextlib import suppress
1416from pathlib import Path
17+ from platform import platform
1518
1619from rinoh import __version__ , __release_date__
1720
8083parser .add_argument ('--version' , action = 'version' ,
8184 version = '%(prog)s {} ({})' .format (__version__ ,
8285 __release_date__ ))
86+ parser .add_argument ('--versions' , action = 'store_true' ,
87+ help = 'list versions of rinohtype and related software (for '
88+ 'inclusion in bug reports)' )
8389parser .add_argument ('--docs' , action = 'store_true' ,
8490 help = 'open the online documentation in the default '
8591 'browser' )
@@ -156,6 +162,14 @@ def main():
156162 global parser
157163 args = parser .parse_args ()
158164 do_exit = False
165+ if args .versions :
166+ print (f'rinohtype { __version__ } ({ __release_date__ } )' )
167+ with suppress (ImportError ):
168+ import sphinx
169+ print (f'Sphinx { sphinx .__version__ } ' )
170+ print (f'Python { sys .version } ' )
171+ print (platform ())
172+ return
159173 if args .docs :
160174 webbrowser .open (DOCS_URL )
161175 return
You can’t perform that action at this time.
0 commit comments