Create task

This commit is contained in:
2018-07-09 02:13:24 +02:00
parent f19965f1a1
commit a0cc2e1e02
3 changed files with 39 additions and 33 deletions

View File

@@ -30,20 +30,21 @@ def handle_project(args, last_action, conn):
if args[0] == '-c':
if len(args) == 1:
print('required project name')
print('missing project name')
sys.exit(1)
project = Project()
project.name = arg_string(args[1], 'project name')
create_project(project, conn)
elif args[0] == '-e':
print('Update project')
print('TODO Update project')
elif args[0] == '-d':
if len(args) > 1:
delete_project(arg_number(args[1]), conn)
else:
delete_project(last_action.project_id, conn)
# TODO Move this function
def arg_string(arg, required = ''):
if required and arg.startswith('-'):
print('required ', required)