Skip to content

Commit

Permalink
Adds -v --version to display version
Browse files Browse the repository at this point in the history
  • Loading branch information
jaymoulin committed Sep 1, 2020
1 parent c4bcadc commit 968858a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
3 changes: 2 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,12 @@ First, launch the daemon to watch a directory new inputs.

.. code::
usage: youtube-music-upload [-h] [--directory DIRECTORY] [--oauth OAUTH] [-r]
usage: youtube-music-upload [-h] [-v] [--directory DIRECTORY] [--oauth OAUTH] [-r]
[-o] [--deduplicate_api DEDUPLICATE_API]
optional arguments:
-h, --help show this help message and exit
-v, --version show version number and exit
--directory DIRECTORY, -d DIRECTORY
Music Folder to upload from (default: .)
--oauth OAUTH, -a OAUTH
Expand Down
2 changes: 1 addition & 1 deletion youtube_music_uploader/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
This program will upload your music library to YouTube Music
"""

__all__ = ['uploader_daemon']
__all__ = ['uploader_daemon', '__version__']
__version__ = '1.0.0'
10 changes: 10 additions & 0 deletions youtube_music_uploader/uploader_daemon.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import glob
import argparse
import requests
from .__init__ import __version__

from watchdog.observers import Observer
from watchdog.events import FileSystemEventHandler
Expand Down Expand Up @@ -177,7 +178,16 @@ def main():
default=None,
help="Deduplicate API (should be HTTP and compatible with the manifest (see README)) (default: None)"
)
parser.add_argument(
"--version",
'-v',
action='store_true',
help="show version number and exit"
)
args = parser.parse_args()
if args.version:
print(__version__)
return
upload(
directory=args.directory,
oauth=args.oauth,
Expand Down

0 comments on commit 968858a

Please sign in to comment.