new version text
@@ -9,10 +9,24 @@ import sys
import numpy
-from .__about__ import __version__
+from .__about__ import __version__, __copyright__
from .helpers import read, write, input_filetypes, output_filetypes
+def _get_version_text():
+ return "\n".join(
+ [
+ "meshio {} [Python {}.{}.{}]".format(
+ __version__,
+ sys.version_info.major,
+ sys.version_info.minor,
+ sys.version_info.micro,
+ ),
+ __copyright__,
+ ]
+ )
+
+
def main(argv=None):
# Parse command line arguments.
parser = _get_parser()
@@ -44,7 +58,10 @@ def _get_parser():
"""Parse input options."""
import argparse
- parser = argparse.ArgumentParser(description=("Convert between mesh formats."))
+ parser = argparse.ArgumentParser(
+ description=("Convert between mesh formats."),
+ formatter_class=argparse.RawTextHelpFormatter,
+ )
parser.add_argument("infile", type=str, help="mesh file to be read from")
@@ -86,7 +103,7 @@ def _get_parser():
"--version",
"-v",
action="version",
- version="%(prog)s {}, Python {}".format(__version__, sys.version),
+ version=_get_version_text(),
help="display version information",
)
