Fix bug that prevented --format pretty and --format short from working (#1177)

This commit is contained in:
Suhas 2021-03-06 13:47:03 -05:00 committed by GitHub
parent b9a6d029e2
commit a3f4f6b944
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 79 additions and 2 deletions

View file

@ -323,9 +323,12 @@ def _delete_search_results(journal, old_entries, **kwargs):
def _display_search_results(args, journal, **kwargs):
if args.short:
if args.short or args.export == "short":
print(journal.pprint(short=True))
elif args.export == "pretty":
print(journal.pprint())
elif args.tags:
print(plugins.get_exporter("tags").export(journal))

View file

@ -27,6 +27,8 @@ __exporters = [
__importers = [JRNLImporter]
__exporter_types = {name: plugin for plugin in __exporters for name in plugin.names}
__exporter_types["pretty"] = None
__exporter_types["short"] = None
__importer_types = {name: plugin for plugin in __importers for name in plugin.names}
EXPORT_FORMATS = sorted(__exporter_types.keys())