diff --git a/CHANGELOG.md b/CHANGELOG.md index ca77eb20..cebd5e32 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,14 @@ Changelog ========= +### 1.5.2 + +* [Improved] Soft-deprecated `-to` for filtering by time and introduces `-until` instead. + +### 1.5.1 + +* [Fixed] Fixed a bug introduced in 1.5.0 that caused the entire journal to be printed after composing an entry + ### 1.5.0 * [Improved] Exporting, encrypting and displaying tags now takes your filter options into account. So you could export everything before May 2012: `jrnl -to 'may 2012' --export json`. Or encrypt all entries tagged with `@work` into a new journal: `jrnl @work --encrypt work_journal.txt`. Or display all tags of posts where Bob is also tagged: `jrnl @bob --tags` diff --git a/README.md b/README.md index 71fe1716..e92ba029 100644 --- a/README.md +++ b/README.md @@ -58,7 +58,7 @@ _jrnl_ has two modes: __composing__ and __viewing__. will list you the ten latest entries, - jrnl -from "last year" -to march + jrnl -from "last year" -until march everything that happened from the start of last year to the start of last march. If you only want to see the titles of your entries, use diff --git a/features/exporting.feature b/features/exporting.feature index 7f58876f..5b3e940f 100644 --- a/features/exporting.feature +++ b/features/exporting.feature @@ -10,13 +10,13 @@ Feature: Expoting a Journal and "tags" in the json output should contain "@journal" and "tags" in the json output should contain "@dan" - Scenario: Exporting using filters should only export parts of the journal - Given we use the config "tags.json" - When we run "jrnl -to 'may 2013' --export json" - # Then we should get no error - Then the output should be parsable as json - and "entries" in the json output should have 1 element - and "tags" in the json output should contain "@idea" - and "tags" in the json output should contain "@journal" - and "tags" in the json output should not contain "@dan" + Scenario: Exporting using filters should only export parts of the journal + Given we use the config "tags.json" + When we run "jrnl -until 'may 2013' --export json" + # Then we should get no error + Then the output should be parsable as json + and "entries" in the json output should have 1 element + and "tags" in the json output should contain "@idea" + and "tags" in the json output should contain "@journal" + and "tags" in the json output should not contain "@dan" diff --git a/features/regression.feature b/features/regression.feature new file mode 100644 index 00000000..c4cf41e7 --- /dev/null +++ b/features/regression.feature @@ -0,0 +1,8 @@ +Feature: Zapped bugs should stay dead. + + Scenario: Writing an entry does not print the entire journal + Given we use the config "basic.json" + When we run "jrnl 23 july 2013: A cold and stormy day. I ate crisps on the sofa." + Then we should see the message "Entry added" + When we run "jrnl -n 1" + Then the output should not contain "Life is good" diff --git a/features/steps/core.py b/features/steps/core.py index bceab051..f6c54564 100644 --- a/features/steps/core.py +++ b/features/steps/core.py @@ -102,6 +102,11 @@ def check_output_inline(context, text): out = context.stdout_capture.getvalue() assert text in out +@then('the output should not contain "{text}"') +def check_output_not_inline(context, text): + out = context.stdout_capture.getvalue() + assert text not in out + @then('we should see the message "{text}"') def check_message(context, text): out = context.messages.getvalue() diff --git a/jrnl/__init__.py b/jrnl/__init__.py index 6c783c61..4ee7ee31 100644 --- a/jrnl/__init__.py +++ b/jrnl/__init__.py @@ -7,7 +7,7 @@ jrnl is a simple journal application for your command line. """ __title__ = 'jrnl' -__version__ = '1.5.0' +__version__ = '1.5.2' __author__ = 'Manuel Ebert' __license__ = 'MIT License' __copyright__ = 'Copyright 2013 Manuel Ebert' diff --git a/jrnl/jrnl.py b/jrnl/jrnl.py index 256075ce..97c01d74 100755 --- a/jrnl/jrnl.py +++ b/jrnl/jrnl.py @@ -39,7 +39,7 @@ def parse_args(args=None): reading = parser.add_argument_group('Reading', 'Specifying either of these parameters will display posts of your journal') reading.add_argument('-from', dest='start_date', metavar="DATE", help='View entries after this date') - reading.add_argument('-to', dest='end_date', metavar="DATE", help='View entries before this date') + reading.add_argument('-until', '-to', dest='end_date', metavar="DATE", help='View entries before this date') reading.add_argument('-and', dest='strict', action="store_true", help='Filter by tags using AND (default: OR)') reading.add_argument('-n', dest='limit', default=None, metavar="N", help='Shows the last n entries matching the filter', nargs="?", type=int) reading.add_argument('-short', dest='short', action="store_true", help='Show only titles or line containing the search tags') @@ -184,7 +184,7 @@ def cli(manual_args=None): journal.limit(args.limit) # Reading mode - if not mode_export: + if not mode_compose and not mode_export: print(journal.pprint()) # Various export modes