Commit 9bc283b1 authored by Bram Schoenmakers's avatar Bram Schoenmakers

Don't allow empty project or context names.

A @ or + must be followed by at least one non-whitespace character to
qualify.
parent 5142c2b4
......@@ -63,11 +63,11 @@ def parse_line(p_string):
rest = normal_head.group('rest')
for word in rest.split():
project = re.match(r'\+(.*)', word)
project = re.match(r'\+(\S+)', word)
if project:
result['projects'].append(project.group(1))
context = re.match('@(.*)', word)
context = re.match(r'@(\S+)', word)
if context:
result['contexts'].append(context.group(1))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment