Skip to content

Commit

Permalink
Use defined show_title
Browse files Browse the repository at this point in the history
  • Loading branch information
elliotwutingfeng authored Feb 23, 2024
1 parent 8b62a49 commit 0e93aab
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/norwegianblue/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,14 +134,14 @@ 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,8 +161,7 @@ def main() -> None:
product=suggestion,
format=args.formatter,
color=args.color,
show_title=(args.show_title == "yes")
or (multiple_products and args.show_title != "no"),
show_title=show_title,
)
print(output)
print()
Expand Down

0 comments on commit 0e93aab

Please sign in to comment.