aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Robin Obůrka <r.oburka@gmail.com> 2016-02-28 20:26:11 +0100
committerGravatar Robin Obůrka <r.oburka@gmail.com> 2016-02-28 20:26:11 +0100
commit36594b0c046417a6a5f04364ed47b434f4aeceb5 (patch)
tree4d43aa97c225f3f94977be50e4df6b2c3ef92be7
parentMake refactoring of assign_to_person to common reusable code (diff)
downloadtodoist-36594b0c046417a6a5f04364ed47b434f4aeceb5.tar.xz
Change behavior projects: Approximative definition is possible now
-rwxr-xr-xtodoist10
1 files changed, 5 insertions, 5 deletions
diff --git a/todoist b/todoist
index cd469c3..8a45c90 100755
--- a/todoist
+++ b/todoist
@@ -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: