Add -V/--version flag

This commit is contained in:
Linus Groh
2018-04-17 14:15:51 +02:00
parent 678068c4fe
commit 2c487df118
2 changed files with 9 additions and 0 deletions

View File

@@ -108,6 +108,10 @@ def get_arguments(raw_args=None, to_group=True, to_merge=True):
group.add_argument(
'-u', '--username',
help="load tracks from user's playlist into <playlist_name>.txt")
group.add_argument(
'-V', '--version',
help="show version and exit",
action='store_true')
parser.add_argument(
'-m', '--manual', default=config['manual'],

View File

@@ -171,6 +171,11 @@ def download_single(raw_song, number=None):
def main():
const.args = handle.get_arguments()
if const.args.version:
print('spotdl {version}'.format(version=__version__))
sys.exit()
internals.filter_path(const.args.folder)
youtube_tools.set_api_key()