Skip to content

Commit

Permalink
added --version argument
Browse files Browse the repository at this point in the history
  • Loading branch information
rneher committed Oct 10, 2019
1 parent afd24b0 commit 67db41b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion treetime/argument_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 67db41b

Please sign in to comment.