Sha256: 3492dd59811e4022b77042175a2c66fca7ac1355041f938cb7d01a941bbf470d

Contents?: true

Size: 1.68 KB

Versions: 1

Compression:

Stored size: 1.68 KB

Contents

#! /usr/bin/env ruby

require 'task_report'

def show_usage_message(exit_status = 0)
  puts \
"Use `task` as follows:

  `task start TASK-DESCRIPTION`
    - finds or creates a new gist for today
    - adds a new item with the provided TASK-DESCRIPTION

  `task stop`
    - stops time tracking the current task, if it exists

  `task continue [TASK-ID, TASK-DESCRIPTION]`
    - continues tracking the provided task, or latest task if none if provided

  `task current`
    - lists the currently ongoing task

  `task list`
    - Lists all of today's tasks

  `task summary [--gist, -g]`
    - prints a task summary to the command line
    - if the `--gist` or `-g` options are used, creates a markdown gist summary
      and prints the link to stdout

  `task delete {TASK-ID, TASK-DESCRIPTION, today, gist}`
    - deletes the provided task if it exists
    - if 'today' is passed, then all tasks in today's report will be deleted
    - if 'gist' is passed, then the whole report gist for today will be deleted

  `task note TASK_ID TASK_NOTE`
    - adds arbitrary note TASK_NOTE to task TASK_ID
    - these notes will be appear in summaries as line items (markdown supported)

  `task total`
    - displays the total tracked time for today

  `task help`
    - shows this message"

  exit exit_status
end

TaskReport.read_config

case ARGV[0]
when 'list'
  TaskReport.list
when 'start'
  TaskReport.start(ARGV[1])
when 'stop'
  TaskReport.stop
when 'continue'
  TaskReport.continue(ARGV[1])
when 'delete'
  TaskReport.delete(ARGV[1])
when 'current'
  TaskReport.current
when 'summary'
  TaskReport.summary(ARGV[1])
when 'note'
  TaskReport.note(ARGV[1], ARGV[2])
when 'total'
  TaskReport.total
else
  show_usage_message
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
task_report-0.5.3 bin/task