Skip to content

Commit

Permalink
Handle --version argument
Browse files Browse the repository at this point in the history
  • Loading branch information
dbrgn committed Jan 8, 2016
1 parent 14acff1 commit 6ef3fae
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
7 changes: 7 additions & 0 deletions orochi/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,)

Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 6ef3fae

Please sign in to comment.