diff options
author | Christian Cleberg <hello@cmc.pub> | 2025-03-29 00:23:35 -0500 |
---|---|---|
committer | Christian Cleberg <hello@cmc.pub> | 2025-03-29 00:23:35 -0500 |
commit | ea85cd451eb052e80b38a04e25918290094325b4 (patch) | |
tree | 443fccfc7fe2a23443ac993e84436a757b3efc77 /nba/cli.py | |
download | nba-scores-ea85cd451eb052e80b38a04e25918290094325b4.tar.gz nba-scores-ea85cd451eb052e80b38a04e25918290094325b4.tar.bz2 nba-scores-ea85cd451eb052e80b38a04e25918290094325b4.zip |
initial commit
Diffstat (limited to 'nba/cli.py')
-rw-r--r-- | nba/cli.py | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/nba/cli.py b/nba/cli.py new file mode 100644 index 0000000..a1a3eb6 --- /dev/null +++ b/nba/cli.py @@ -0,0 +1,25 @@ +""" +This script uses argparse to parse command line arguments. + +It imports the required modules and sets up a parser with basic options for demonstration purposes. +""" +import argparse +from nba import fetch_data, scores, standings + +def nba() -> None: + """ + Parse command-line arguments and display either scoreboard or standings. + """ + parser = argparse.ArgumentParser(description="NBA Scoreboard and Standings") + parser.add_argument('--scores', action='store_true', help='Display the scoreboard') + parser.add_argument('--standings', action='store_true', help='Display the standings') + args = parser.parse_args() + + games, standings = fetch_data.fetch_data() + + if args.scores: + scores.build_scoreboard(games, standings) + elif args.standings: + standings.build_standings(standings) + else: + print("Please specify --scores or --standings")
\ No newline at end of file |