diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 61d0895..9235c75 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -11,6 +11,7 @@ UNRELEASED - [add] Persist readline history - [add] Set terminal title to song status - [bug] Fixed bug that occurs if a track doesn't have an artist specified (#68) +- [add] Support ``-v`` / ``--version`` argument v0.1.3 (2016-01-06) diff --git a/orochi/client.py b/orochi/client.py index d8beef9..4ed8e92 100644 --- a/orochi/client.py +++ b/orochi/client.py @@ -19,6 +19,7 @@ from .errors import InitializationError, TerminatedError from .colors import bold, title from .xdg import get_orochi_xdg_dir +from . import meta PY3 = sys.version_info > (3,) @@ -810,6 +811,12 @@ def main(): client.cmdloop() if __name__ == '__main__': + + # Handle version printing + if '-v' in sys.argv or '--version' in sys.argv: + print('%s v%s' % (meta.title, meta.version)) + sys.exit(0) + try: main() except Exception as ex: