Add machine readable --list output (#1592)

* Add machine readable --list output

* Refactor list_journals()

Create three new methods for each journal list format.
- JSON, YAML, STDOUT

* Added journal list export test

* Update test regex to handle windows filepaths
This commit is contained in:
Kevin 2022-09-24 12:46:49 -07:00 committed by GitHub
parent 057f31407a
commit 2df7acf488
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 62 additions and 9 deletions

View file

@ -56,10 +56,10 @@ def preconfig_version(_):
print(output)
def postconfig_list(config, **kwargs):
def postconfig_list(args, config, **kwargs):
from jrnl.output import list_journals
print(list_journals(config))
print(list_journals(config, args.export))
def postconfig_import(args, config, **kwargs):