From 67db41bd308c1da81683cc49971a5c0a89cf8be7 Mon Sep 17 00:00:00 2001 From: Richard Neher Date: Thu, 10 Oct 2019 14:32:15 +0200 Subject: [PATCH] added --version argument --- treetime/argument_parser.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/treetime/argument_parser.py b/treetime/argument_parser.py index 2e97b9c5..5b928a9b 100644 --- a/treetime/argument_parser.py +++ b/treetime/argument_parser.py @@ -201,6 +201,7 @@ def make_parser(): help = "don't show tip labels (default for small trees with >=30 leaves)") add_anc_arguments(t_parser) add_common_args(t_parser) + t_parser.add_argument("--version", action="version", version="%(prog)s " + treetime.version) def toplevel(params): if (params.aln or params.tree) and params.dates: @@ -279,7 +280,7 @@ def toplevel(params): # make a version subcommand v_parser = subparsers.add_parser('version', description='print version') - v_parser.set_defaults(func=lambda x: print(treetime.version)) + v_parser.set_defaults(func=lambda x: print("treetime "+treetime.version)) ## call the relevant function and return if py2: