mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-06-28 05:26:13 +02:00
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:
parent
057f31407a
commit
2df7acf488
5 changed files with 62 additions and 9 deletions
|
@ -597,3 +597,18 @@ Feature: Custom formats
|
|||
When we run "jrnl --format text --file {cache_dir}"
|
||||
Then the cache directory should contain 5 files
|
||||
And we should get no error
|
||||
|
||||
Scenario: Export journal list to multiple formats.
|
||||
Given we use the config "basic_onefile.yaml"
|
||||
When we run "jrnl --list"
|
||||
Then the output should match
|
||||
Journals defined in config \(.+basic_onefile\.yaml\)
|
||||
\* default -> features/journals/basic_onefile\.journal
|
||||
When we run "jrnl --list --format json"
|
||||
Then the output should match
|
||||
{"config_path": ".+basic_onefile\.yaml", "journals": {"default": "features/journals/basic_onefile\.journal"}}
|
||||
When we run "jrnl --list --format yaml"
|
||||
Then the output should match
|
||||
config_path: .+basic_onefile\.yaml
|
||||
journals:
|
||||
default: features/journals/basic_onefile\.journal
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue