Skip to content

Commit

Permalink
Use args.show_title after accepting suggestion (#198)
Browse files Browse the repository at this point in the history
  • Loading branch information
elliotwutingfeng committed Feb 23, 2024
1 parent ba7789f commit cd24970
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/norwegianblue/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,14 +134,16 @@ def main() -> None:
_cache.clear(clear_all=True)

multiple_products = len(args.product) >= 2
show_title = (args.show_title == "yes") or (
multiple_products and args.show_title != "no"
)
for product in args.product:
try:
output = norwegianblue.norwegianblue(
product=product,
format=args.formatter,
color=args.color,
show_title=(args.show_title == "yes")
or (multiple_products and args.show_title != "no"),
show_title=show_title,
)
except ValueError as e:
suggestion = norwegianblue.suggest_product(product)
Expand All @@ -161,7 +163,7 @@ def main() -> None:
product=suggestion,
format=args.formatter,
color=args.color,
show_title=multiple_products,
show_title=show_title,
)
print(output)
print()
Expand Down

0 comments on commit cd24970

Please sign in to comment.