 cmd.command('start <project> [task] [time] [note]')
     .description('Start a new timer for a given task. Shortcut: s')
     .action (project, task, time, note) ->
-        taskString = project
-        if taskString.match /\./
+        taskString = parseTask project, task
+        if project.match /\./
             note = time
             time = task
-        else
-            taskString += "." + task
 
         commands.start taskString, time, note
 

    .option('-n, --negative', 'Indicate that the number is negative')
    .action (entry, task, note, program) ->
        index = parseInt(entry)
        if not isNaN index 
            index *= -1 if program.negative?
        else
            if entry.match /\./
                note = task
            else
                entry += "." + task
            index = entry

        commands.resume index, note


        when 'projects' then 'project'
        when 'users' then 'user'
        else input

# Helper to parse the project/task string
parseTask = (project, task = "") ->
    taskString = project
    matches = taskString.match /^@?([^@]+)@([^@]+)$/
    if matches
        taskString = matches[2] + "." + matches[1]
    else
        taskString += "." + task
    taskString


# Init/Setup
