Skip to content

Commit

Permalink
make khal new work
Browse files Browse the repository at this point in the history
  • Loading branch information
geier committed Sep 8, 2014
1 parent f5377d3 commit 1e983fd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions khal/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ def _calendar_select_callback(ctx, option, calendars):
else:
raise ValueError(mode)


def calendar_selector(f):
a = click.option('--include-calendar', '-a', multiple=True, metavar='CAL',
expose_value=False, callback=_calendar_select_callback,
Expand Down Expand Up @@ -177,13 +178,13 @@ def agenda(ctx, days, events, dates):
@cli.command()
@click.option('--include-calendar', '-a', help=('The calendar to use.'),
expose_value=False, callback=_calendar_select_callback)
@click.argument('description')
@click.argument('description', nargs=-1)
@click.pass_context
def new(ctx, description):
controllers.NewFromString(
build_collection(ctx),
ctx.obj['conf'],
description.split()
list(description)
)

@cli.command()
Expand Down
3 changes: 2 additions & 1 deletion tests/cli_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@ def test_simple(runner):
assert result.output == 'No events\n'

now = datetime.datetime.now().strftime('%d.%m.%Y')
result = runner.invoke(main_khal, ['new', '{} 18:00 myevent'.format(now)])
result = runner.invoke(
main_khal, ['new'] + '{} 18:00 myevent'.format(now).split())
assert result.output == ''
assert not result.exception

Expand Down

0 comments on commit 1e983fd

Please sign in to comment.