Skip to content
Open
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
9 changes: 7 additions & 2 deletions khal/cli_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,13 @@ def multi_calendar_select(ctx, include_calendars, exclude_calendars):
selection.update(include_calendars)
elif exclude_calendars:
selection.update(ctx.obj['conf']['calendars'].keys())
for value in exclude_calendars:
selection.remove(value)
for cal_name in exclude_calendars:
if cal_name not in selection:
raise click.BadParameter(
f'Unknown calendar {cal_name}, run `khal printcalendars` '
'to get a list of all configured calendars.'
)
selection.discard(cal_name)

return selection or None

Expand Down