Lab is ready

This commit is contained in:
Chris
2022-03-09 17:43:06 -05:00
parent 05ed95fb65
commit 729b179d43
7 changed files with 317 additions and 1 deletions

15
weather/weather_cli.py Normal file
View File

@@ -0,0 +1,15 @@
from argparse import ArgumentParser
from weather.weather import print_weather
def weather_cli():
"""Provides a command-line interface for weather.
This function creates an ArgumentParser, which parses command line arguments.
Then it calls `print_weather` with the provided arguments.
"""
parser = ArgumentParser("weather", description="Prints out a weather report")
parser.add_argument("-l", "--location", help="Location for weather forecast")
parser.add_argument("-m", "--metric", action="store_true", help="Use metric units")
parser.add_argument("-v", "--verbose", action="store_true", help="Verbose output")
args = parser.parse_args()
print_weather(location=args.location, metric=args.metric, verbose=args.verbose)