Skip to content

Commit

Permalink
Fixed error related to display_format in config file
Browse files Browse the repository at this point in the history
Now _display_search_results tries to source the export arg from the
config file before dispaying search results.
  • Loading branch information
apainintheneck committed Jun 4, 2022
1 parent 19d579f commit 30d0902
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions jrnl/jrnl.py
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,9 @@ def _change_time_search_results(args, journal, old_entries, no_prompt=False, **k


def _display_search_results(args, journal, **kwargs):
# Get export format from config file if not provided at the command line
args.export = args.export or kwargs["config"].get("display_format")

if args.short or args.export == "short":
print(journal.pprint(short=True))

Expand All @@ -385,8 +388,5 @@ def _display_search_results(args, journal, **kwargs):
elif args.export:
exporter = plugins.get_exporter(args.export)
print(exporter.export(journal, args.filename))
elif kwargs["config"].get("display_format"):
exporter = plugins.get_exporter(kwargs["config"]["display_format"])
print(exporter.export(journal, args.filename))
else:
print(journal.pprint())

0 comments on commit 30d0902

Please sign in to comment.