         comment = args[2]
         if !currentCase then return error('no taken case')
         cid = currentCase
-    fb.resolve(cid, comment)
+    fb.resolve cid, comment
 
 assign = (args) ->
     cid = parseInt(args[2])
     if isNaN cid then return error('expected case number')
-    fb.assign(args[2], args[3], args[4])
+    fb.assign args[2], args[3], args[4]
 
 log = (args) ->
     cid = parseInt(args[2], 10)

        comment = args[2]
        if !currentCase then return error('no taken case')
        cid = currentCase
    fb.log(cid, comment)

# utils
isfn = (x) -> typeof x == 'function'

ls = (args) ->
    switch args[1]
        when 'f'
            fb.filters().then printTable
        when 'p'
            fb.projects().then printProjects
        when 'u'
            fb.people().then printUsers
        when 'm'
            fb.milestones().then printMilestones
        else
            fb.search()
              .then(filterActiveCases)
              .then printCases

# TODO do not hardcode active status
filterActiveCases = (list) -> list.filter (x) -> x.status.id == 1

search = (args) ->
    # TODO intelligent search
    fb.search(args[2]).then(printCases)

take = (args) ->
    fb.take(args[2], args[3]).then -> currentCase = args[2]

resolve = (args) ->
    cid = parseInt(args[2], 10)
