Skip to content

Commit

Permalink
cli: add setup type, require version action
Browse files Browse the repository at this point in the history
  • Loading branch information
sigma67 committed Jan 17, 2025
1 parent 452b5cd commit 862f507
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion ytmusicapi/setup.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import argparse
import importlib.metadata
import sys
from pathlib import Path
from typing import Optional, Union
Expand Down Expand Up @@ -54,8 +55,15 @@ def setup_oauth(

def parse_args(args):
parser = argparse.ArgumentParser(description="Setup ytmusicapi.")
parser.add_argument(
"-v",
"--version",
action="version",
version=f"ytmusicapi {importlib.metadata.version('ytmusicapi')}",
help="Installed version of ytmusicapi",
)
# parser.add_argument("setup_type", type=str, choices=["oauth", "browser"], help="choose a setup type.")
subparsers = parser.add_subparsers(help="choose a setup type.", dest="setup_type")
subparsers = parser.add_subparsers(help="choose a setup type.", dest="setup_type", required=True)
oauth_parser = subparsers.add_parser(
"oauth",
help="create an oauth token using your Google Youtube API credentials; type 'ytmusicapi oauth -h' for details.",
Expand Down

0 comments on commit 862f507

Please sign in to comment.