diff options
author | Robin Obůrka <r.oburka@gmail.com> | 2016-02-28 20:26:11 +0100 |
---|---|---|
committer | Robin Obůrka <r.oburka@gmail.com> | 2016-02-28 20:26:11 +0100 |
commit | 36594b0c046417a6a5f04364ed47b434f4aeceb5 (patch) | |
tree | 4d43aa97c225f3f94977be50e4df6b2c3ef92be7 | |
parent | Make refactoring of assign_to_person to common reusable code (diff) | |
download | todoist-36594b0c046417a6a5f04364ed47b434f4aeceb5.tar.xz |
Change behavior projects: Approximative definition is possible now
-rwxr-xr-x | todoist | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -152,11 +152,11 @@ def main(): ## Set project if args.project: - proj = args.project.lower() - if proj in projects: - kwargs["project_id"] = projects[proj] - else: - print("WARNING: Unknown project. Task will be stored in Inbox", file=sys.stderr) + proj, err = find_candidate(args.project.lower(), projects) + if not proj: + print("Set project error:", err, file=sys.stderr) + sys.exit(1) + kwargs["project_id"] = proj ## Set priority/severity if args.severity: |