aboutsummaryrefslogtreecommitdiffstats
path: root/fnme/cli.py
diff options
context:
space:
mode:
Diffstat (limited to 'fnme/cli.py')
-rw-r--r--fnme/cli.py15
1 files changed, 12 insertions, 3 deletions
diff --git a/fnme/cli.py b/fnme/cli.py
index 203391c..3d7d72e 100644
--- a/fnme/cli.py
+++ b/fnme/cli.py
@@ -15,14 +15,20 @@ _PRICE_COLS = {
"diesel_price": "B7S (£/L)",
}
-_HEADERS = {"station_name": "Station Name", "distance": "Distance (mi)", **_PRICE_COLS}
+_HEADERS = {
+ "station_name": "Station Name",
+ "distance": "Distance (mi)",
+ **_PRICE_COLS,
+}
def parse_args() -> argparse.Namespace:
parser = argparse.ArgumentParser()
parser.add_argument("-a", "--address", type=str, required=True)
parser.add_argument("-r", "--radius", type=int, default=5)
- parser.add_argument("-s", "--sort", type=str, default="e10", choices=SORT_KV.keys())
+ parser.add_argument(
+ "-s", "--sort", type=str, default="e10", choices=SORT_KV.keys()
+ )
return parser.parse_args()
@@ -35,7 +41,10 @@ def output_stations(stations: List[Dict[str, Any]]) -> None:
print("[*] No stations found.")
return
- rows = [{**s, **{col: _fmt_price(s[col]) for col in _PRICE_COLS}} for s in stations]
+ rows = [
+ {**s, **{col: _fmt_price(s[col]) for col in _PRICE_COLS}}
+ for s in stations
+ ]
print(tabulate(rows, headers=_HEADERS, floatfmt="1.f"))
git.ajschof.me — hosted by ajschofield — powered by cgit