def command(message, time, project, category, links): """ Use this command to start a new task, this command will track when the task started and this information as a metadata of your task. $ trackmywork start -m "Starting my task" -p "trackmywork" -c "personal" -t 2h You successfully started the task 1 - "Starting my task" # Adding links to a task $ trackmywork start -m "Task with links" -l "http://google.com" -t 2h The task 2 - "Task with links" was started with success. """ task = Task.create( message=message, time=time, category=category, links=links, project=project ) task.start() task = storage.save(task) click.echo(f'The task {task.id} - "{task.message}" was started with success.')
def command(message, time, project, category, links): """ Use this command to register a task without tracking the start and finish time. $ trackmywork register -m "Starting my task" -p "trackmywork" -c "personal" -t 2h The task 1 - "Starting my task" was registered with success. """ task = Task.create(message=message, time=time, category=category, links=links, project=project) task.start() task.finish() task = storage.save(task) click.echo( f'The task {task.id} - "{task.message}" was registered with success.')