diff --git a/jupyter_book/__init__.py b/jupyter_book/__init__.py index fafcc069d8370eb3be05d76025138c41671d453c..bfbe27ad5f24a80cf6e490dee904acb0a42c7135 100644 --- a/jupyter_book/__init__.py +++ b/jupyter_book/__init__.py @@ -1,2 +1,2 @@ """Build an online book using Jupyter Notebooks and Jekyll.""" -__version__ = "0.5.2dev0" +__version__ = "0.5.2" diff --git a/jupyter_book/commands/__init__.py b/jupyter_book/commands/__init__.py index c22506b70f09f25727c777112b877de6e4b37fb0..a4f5a990f4a52bd4aa5a28da37cfe54704784b6a 100644 --- a/jupyter_book/commands/__init__.py +++ b/jupyter_book/commands/__init__.py @@ -3,3 +3,4 @@ from .build import build from .create import create from .upgrade import upgrade from .run import run +from .version import version diff --git a/jupyter_book/commands/version.py b/jupyter_book/commands/version.py new file mode 100644 index 0000000000000000000000000000000000000000..a35c46df6ed4eb8124bf271e266a98e90421219f --- /dev/null +++ b/jupyter_book/commands/version.py @@ -0,0 +1,9 @@ +import sys +import argparse +from jupyter_book import __version__ + +def version(): + parser = argparse.ArgumentParser( + description="Print the version of Jupyter Book currently in-use.") + + print("Running Jupyter Book version: {}".format(__version__)) \ No newline at end of file diff --git a/jupyter_book/main.py b/jupyter_book/main.py index 26f6e15727d90f4bfb4eeb2bbee7202d55d5840e..7c565ba52b89d5b09f8ae2e516f3a451fbc22271 100644 --- a/jupyter_book/main.py +++ b/jupyter_book/main.py @@ -1,7 +1,7 @@ import sys import argparse -from .commands import build, create, upgrade +from .commands import build, create, upgrade, version from .run import run_book from .toc import build_toc @@ -12,7 +12,8 @@ commands = {'create': create, 'build': build, 'upgrade': upgrade, 'run': run_book, - 'toc': build_toc} + 'toc': build_toc, + 'version': version} parser = argparse.ArgumentParser(description=DESCRIPTION) parser.add_argument("command", help="The command you'd like to run. Allowed commands: {}".format( list(commands.keys())))