Skip to content

Commit

Permalink
print version from the commandline
Browse files Browse the repository at this point in the history
  • Loading branch information
seird committed Apr 30, 2022
1 parent 1970896 commit 5fbdcca
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 6 deletions.
4 changes: 2 additions & 2 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
include README.md version.txt
include gotifytray/gui/images/*.png
include gotifytray/gui/images/*.svg
include gotify_tray/gui/images/*.png
include gotify_tray/gui/images/*.svg
1 change: 0 additions & 1 deletion gotify_tray/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
from .gui import start_gui
14 changes: 12 additions & 2 deletions gotify_tray/__main__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
from gotify_tray.gui import start_gui
def main():
import sys

start_gui()
if "--version" in sys.argv:
from gotify_tray.__version__ import __version__
print(__version__)
else:
from gotify_tray.gui import start_gui
start_gui()


if __name__ == "__main__":
main()
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
],

entry_points={
'console_scripts': ['gotify-tray=gotify_tray:start_gui'],
'console_scripts': ['gotify-tray=gotify_tray.__main__:main'],
},
install_requires=REQUIRED,
extras_require=EXTRAS,
Expand Down

0 comments on commit 5fbdcca

Please sign in to comment.