Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions AUTHORS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,4 @@ Pi R
Alnoman Kamil - noman [at] kamil [dot] gr - https://kamil.gr
Leonardo Taccari - iamleot [at] gmail [dot] com
Jorenar - dev [at] jorenar [dot] com - https://jorenar.com
John Wassilak - john [at] wassilak [dot] com
6 changes: 6 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ Package maintainers and users who have to manually update their installation
may want to subscribe to `GitHub's tag feed
<https://github.com/geier/khal/tags.atom>`_.

0.14.2
======
unreleased
* FIX ``khal import --format``/``-f`` was accepted and then ignored, always
falling back to ``view.event_format``

0.14.1
======
2026-08-21
Expand Down
1 change: 1 addition & 0 deletions khal/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,7 @@ def isatty(_file):
ics=ics_str,
batch=batch,
random_uid=random_uid,
format=format,
env={"calendars": ctx.obj["conf"]["calendars"]},
)
except FatalError as error:
Expand Down
24 changes: 24 additions & 0 deletions tests/cli_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -644,6 +644,30 @@ def test_import_proper(runner):
assert result.output == "09.04.-09.04. An Event\n"


def test_import_format(runner):
"""`--format` should be honored, not silently replaced by view.event_format."""
runner = runner()
result = runner.invoke(
main_khal,
["import", "--format", "{title}", _get_ics_filepath("cal_d")],
input="0\ny\n",
)
assert not result.exception
assert result.output.startswith("An Event")


def test_import_format_repeat_pattern(runner):
"""The recurrence rule is available on import, like anywhere else."""
runner = runner()
result = runner.invoke(
main_khal,
["import", "-f", "{title} {repeat-pattern}", _get_ics_filepath("event_r_past")],
input="0\ny\n",
)
assert not result.exception
assert result.output.startswith("Dummy's Birthday (1965) FREQ=YEARLY")


def test_import_proper_invalid_timezone(runner):
runner = runner()
result = runner.invoke(
Expand Down
Loading