Skip to content

Commit

Permalink
Merge pull request #156 from MetOffice/version-command
Browse files Browse the repository at this point in the history
Add version command
  • Loading branch information
jfrost-mo authored Jul 12, 2023
2 parents 732d5e2 + c9b27c9 commit 02e22a5
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/CSET/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import logging
from pathlib import Path
import os
from importlib.metadata import version


def main():
Expand All @@ -34,6 +35,10 @@ def main():
default=0,
help="increase output verbosity, may be specified multiple times",
)
parser.add_argument(
"--version", action="version", version=f"CSET v{version('CSET')}"
)

# https://docs.python.org/3/library/argparse.html#sub-commands
subparsers = parser.add_subparsers(title="subcommands", dest="subparser")

Expand Down

0 comments on commit 02e22a5

Please sign in to comment.