Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions openml/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from urllib.parse import urlparse

from openml import config
from openml.__version__ import __version__


def is_hex(string_: str) -> bool:
Expand Down Expand Up @@ -331,6 +332,13 @@ def main() -> None:
subroutines = {"configure": configure}

parser = argparse.ArgumentParser()
# Add a global --version flag to display installed version and exit
parser.add_argument(
"--version",
action="version",
version=f"%(prog)s {__version__}",
help="Show the OpenML version and exit",
)
subparsers = parser.add_subparsers(dest="subroutine")

parser_configure = subparsers.add_parser(
Expand Down