#! /bin/bash

rm pending.data completed.data undo.data

echo 'data.location=.' > x
echo 'color=off' >> x
echo 'color.summary.background=on gray3' >> x

# Basic usage
echo Basic usage
echo task rc:x add Select a free weekend in August
task rc:x add Select a free weekend in August
echo task rc:x add Select and book a venue
task rc:x add Select and book a venue
echo task rc:x add Come up with a guest list
task rc:x add Come up with a guest list
echo task rc:x add Mail invitations
task rc:x add Mail invitations
echo task rc:x add Select a caterer
task rc:x add Select a caterer
echo task rc:x list
task rc:x list
echo task rc:x log Order a special cake
task rc:x log Order a special cake
echo task rc:x 4 duplicate /Mail/Design/
task rc:x 4 duplicate /Mail/Design/
echo task rc:x 4 duplicate /Mail/Print/
task rc:x 4 duplicate /Mail/Print/
echo task rc:x list
task rc:x list
echo task rc:x 3 done
task rc:x 3 done
echo task rc:x list
task rc:x list

# Projects
echo Projects
echo task rc:x add Pay teh rent on teh 31st
task rc:x add Pay teh rent on teh 31st
echo task rc:x 7 /teh/the/g
task rc:x 7 /teh/the/g
echo task rc:x list
task rc:x list
echo task rc:x 7 project:home
task rc:x 7 project:home
echo task rc:x 1-6 project:party
echo 'All' | task rc:x 1-6 project:party
echo task rc:x projects
task rc:x projects
echo task rc:x list project:home
task rc:x list project:home
echo task rc:x li pro:par
task rc:x li pro:par

# Priorities
echo Priorities
echo task rc:x 1-3,5 priority:H
echo 'All' | task rc:x 1-3,5 priority:H
echo task rc:x list
task rc:x list
echo task rc:x 3 pri:
task rc:x 3 pri:

# Tags
echo Tags
echo task rc:x list
task rc:x list
echo task rc:x 3,5,6 +mall
echo 'All' | task rc:x 3,5,6 +mall
echo task rc:x long
task rc:x long
echo task rc:x list +mall
task rc:x list +mall
echo task rc:x 3 -mall
task rc:x 3 -mall

# Modifications
echo Modifications
echo task rc:x 7 Pay rent at the end of the month
echo 'Yes' | task rc:x 7 Pay rent at the end of the month
echo task rc:x add music
task rc:x add music
echo task rc:x 8 prepend Select some
task rc:x 8 prepend Select some
echo task rc:x 8 append for after dinner
task rc:x 8 append for after dinner
echo task rc:x list
task rc:x list
echo task rc:x edit
#task rc:x edit
echo task rc:x add Hire a band?
#task rc:x add Hire a band?
echo task rc:x add Hire a band\?
#task rc:x add Hire a band\?
echo task rc:x add "Hire a band?"
#task rc:x add "Hire a band?"
echo task rc:x add -- Hire a band\? +dj
task rc:x add -- Hire a band\? +dj
echo task rc:x undo
echo 'y' | task rc:x undo
echo task rc:x 1 delete
echo 'y' | task rc:x 1 delete
echo task rc:x undo
echo 'y' | task rc:x undo

# Info
echo Info
echo task rc:x 1 info
task rc:x 1 info
echo task rc:x stats
task rc:x stats

# Annotations
echo Annotations
echo task rc:x 1 annotate the 12th looks good
task rc:x 1 annotate the 12th looks good
sleep 1
echo task rc:x 1 annotate or the 13th
task rc:x 1 annotate or the 13th
echo task rc:x list
task rc:x list
echo task rc:x list rc.annotations:full
task rc:x list rc.annotations:full
echo task rc:x list rc.annotations:sparse
task rc:x list rc.annotations:sparse
echo task rc:x list rc.annotations:none
task rc:x list rc.annotations:none
echo task rc:x 1 denotate 13th
task rc:x 1 denotate 13th
echo task rc:x list
task rc:x list

# Configuration
echo Configuration
echo task rc:x show
task rc:x show
echo task rc:x config answer 42
echo 'y' | task rc:x config answer 42
echo task rc:x show answer
task rc:x show answer
echo task rc:x config answer
echo 'y' | task rc:x config answer
echo task rc:x rc.report.list.sort=description+ list
task rc:x rc.report.list.sort=description+ list

# Defaults
echo Defaults
echo task rc:x config default.command list
echo 'y' | task rc:x config default.command list
echo task rc:x
task rc:x
echo task rc:x config default.priority H
echo 'y' | task rc:x config default.priority H
echo task rc:x config default.project Work
echo 'y' | task rc:x config default.project Work
echo task rc:x add New task
task rc:x add New task
echo task rc:x list
task rc:x list
echo task rc:x undo
echo 'y' | task rc:x undo
echo task rc:x config default.priority
echo 'y' | task rc:x config default.priority
echo task rc:x config default.project
echo 'y' | task rc:x config default.project

# Aliases
echo Aliases
echo task rc:x config alias.zzz list
echo 'y' | task rc:x config alias.zzz list
echo task rc:x zzz
task rc:x zzz

# Color
echo Color
echo task rc:x config color on
echo 'y' | task rc:x config color on
echo task rc:x list
task rc:x list
echo task rc:x 1 bg:on_red
task rc:x 1 bg:on_red
echo task rc:x list
task rc:x list
echo task rc:x 1 bg:
task rc:x 1 bg:
echo task rc:x color
task rc:x color
echo task rc:x color white on red
task rc:x color white on red
echo task rc:x color legend
task rc:x color legend
echo vi ~/.taskrc # include /usr/local/share/doc/task/rc/dark-blue-256.theme
#vi ~/.taskrc # include /usr/local/share/doc/task/rc/dark-blue-256.theme
echo 'include /usr/local/share/doc/task/rc/dark-blue-256.theme' >> x
echo task rc:x color legend
task rc:x color legend
echo task rc:x list
task rc:x list
echo vi ~/.taskrc # include /usr/local/share/doc/task/rc/dark-red-256.theme
#vi ~/.taskrc # include /usr/local/share/doc/task/rc/dark-red-256.theme
sed 's/blue/red/' x >x2 && mv x2 x
echo task rc:x color legend
task rc:x color legend
echo task rc:x list
task rc:x list
echo vi ~/.taskrc # include /usr/local/share/doc/task/rc/dark-256.theme
#vi ~/.taskrc # include /usr/local/share/doc/task/rc/dark-256.theme
sed 's/red-//' x >x2 && mv x2 x
echo task rc:x list
task rc:x list
echo task rc:x "rc.color.project.party=on rgb001" rc.color.keyword.invit=bold list
task rc:x "rc.color.project.party=on rgb001" rc.color.keyword.invit=bold list
echo man task-color
#man task-color

# Active tasks
echo Active tasks
echo task rc:x 2 start
task rc:x 2 start
echo task rc:x list
task rc:x list
echo task rc:x active
task rc:x active
echo task rc:x 2 stop
task rc:x 2 stop

# Due dates
echo Due dates
echo task rc:x 1 due:7/31/2010
task rc:x 1 due:7/31/2010
echo task rc:x 1 due:2wks
task rc:x 1 due:2wks
echo task rc:x 1 due:-2wks
task rc:x 1 due:-2wks
echo task rc:x 1 due:eom
task rc:x 1 due:eom
echo task rc:x 2 due:8th
task rc:x 2 due:8th
echo task rc:x 2 due:sunday
task rc:x 2 due:sunday
echo task rc:x 5 due:eow
task rc:x 5 due:eow
echo task rc:x list
task rc:x list
echo task rc:x overdue
task rc:x overdue
echo task rc:x rc.dateformat.report:Y-M-DTH:N:SZ list
task rc:x rc.dateformat.report:Y-M-DTH:N:SZ list

# Calendar
echo Calendar
echo task rc:x calendar
task rc:x calendar
echo vi ~/.taskrc # include /usr/local/share/doc/task/rc/holidays-US.rc
#vi ~/.taskrc # include /usr/local/share/doc/task/rc/holidays-US.rc
echo 'include /usr/local/share/doc/task/rc/holidays-US.rc' >> x
echo task rc:x calendar
task rc:x calendar
echo task rc:x cal 2010
task rc:x cal 2010
echo task rc:x rc.calendar.details:full cal
task rc:x rc.calendar.details:full cal
echo task rc:x rc.calendar.holidays:full cal
task rc:x rc.calendar.holidays:full cal

# Recurrence
echo Recurrence
echo task rc:x 7 info
task rc:x 7 info
echo task rc:x 7 due:eom recur:monthly
task rc:x 7 due:eom recur:monthly
echo task rc:x 7
task rc:x 7
echo task rc:x 7 until:eoy
task rc:x 7 until:eoy
echo task rc:x recurring
task rc:x recurring
echo task rc:x add Pay taxes due:4/15/2007 recur:yearly
task rc:x add Pay taxes due:4/15/2007 recur:yearly
echo task rc:x long
task rc:x long
echo task rc:x 11 delete
printf "y\ny\n" | task rc:x 11 delete      # y, y
echo task rc:x list
task rc:x list

# Shell
echo Shell
echo task rc:x shell
#task rc:x shell
echo '> projects'
#> projects
echo '> tags'
#> tags
echo '> list'
#> list
echo '> quit'
#> quit

# Special tags
echo Special tags
echo task rc:x 6 +nocolor
task rc:x 6 +nocolor
echo task rc:x list
task rc:x list
echo task rc:x tags
task rc:x tags
echo task rc:x 6 -nocolor
task rc:x 6 -nocolor

# Waiting
echo Waiting
echo task rc:x add Look for new apartment due:eoy
task rc:x add Look for new apartment due:eoy
echo task rc:x list
task rc:x list
echo task rc:x 10 wait:12/1/2010
task rc:x 10 wait:12/1/2010
echo task rc:x list
task rc:x list
echo task rc:x waiting
task rc:x waiting
echo task rc:x add Do something in a few seconds
task rc:x add Do something in a few seconds
echo task rc:x 11 wait:5s
task rc:x 11 wait:5s
echo task rc:x list
task rc:x list
sleep 5
echo task rc:x list
task rc:x list
echo task rc:x 11 rc.confirmation:no delete
task rc:x 11 rc.confirmation:no delete

# Dependencies
echo Dependencies





# Reports
echo Reports
echo task rc:x minimal
task rc:x minimal
echo task rc:x ls
task rc:x ls
echo task rc:x list
task rc:x list
echo task rc:x long
task rc:x long
echo task rc:x all
task rc:x all
echo task rc:x completed
task rc:x completed
echo task rc:x recurring
task rc:x recurring
echo task rc:x waiting
task rc:x waiting
echo task rc:x blocked
task rc:x blocked
echo task rc:x oldest
task rc:x oldest
echo task rc:x newest
task rc:x newest
echo task rc:x timesheet
task rc:x timesheet
echo task rc:x next
task rc:x next

# Custom report
echo Custom report
echo 'report.foo.description=My own report'     >> x
echo 'report.foo.columns=id,entry,description'  >> x
echo 'report.foo.labels=ID,Entered,Description' >> x
echo 'report.foo.sort=entry+,description+'      >> x
echo 'report.foo.filter=status:pending'         >> x
echo 'task help | grep foo'
task rc:x help | grep foo
echo task rc:x show report.foo
task rc:x show report.foo
echo task rc:x foo
task rc:x foo

# Charts
echo Charts
echo task rc:x history
task rc:x history
echo task rc:x history.annual
task rc:x history.annual
echo task rc:x ghistory
task rc:x ghistory
echo task rc:x ghistory.annual
task rc:x ghistory.annual
echo task rc:x rc.color.summary.background:"on gray3" summary
task rc:x rc.color.summary.background:"on gray3" summary

# Advanced filters
echo Advanced filters
echo task rc:x list
task rc:x list
echo task rc:x list invit
task rc:x list invit
echo task rc:x list description.contains:invit
task rc:x list description.contains:invit
echo task rc:x list desc.word:the
task rc:x list desc.word:the
echo task rc:x list desc.noword:invitations
task rc:x list desc.noword:invitations
echo task rc:x list pro:party
task rc:x list pro:party
echo task rc:x list pro.is:party
task rc:x list pro.is:party
echo task rc:x list pro.not:party
task rc:x list pro.not:party
echo task rc:x list pro:party priority.over:L
task rc:x list pro:party priority.over:L
echo task rc:x list pro:party limit:2
task rc:x list pro:party limit:2
echo task rc:x list limit:page
task rc:x list limit:page
echo task rc:x all status:pending
task rc:x all status:pending
echo task rc:x all status:waiting
task rc:x all status:waiting

# Import/export
echo Import/export
echo task rc:x export.csv
task rc:x export.csv
echo task rc:x export.csv venue
task rc:x export.csv venue
task rc:x export.vcalendar venue
task rc:x export.vcalendar venue
task rc:x export.yaml venue
task rc:x export.yaml venue

cat <<EOF >file.text
Remember to read the task man page
EOF
cat file.text
echo task rc:x import file.text
printf "y\n" | task rc:x import file.text

cat <<EOF >file.yaml
%YAML 1.1
---
  task:
    description: Visit http://taskwarrior.org
    due: 1281844800
    entry: 1281289630
    priority: H
    project: work
    status: pending
    uuid: 23afada0-a446-8d5a-c213-30d99d52c4b0
...
EOF
cat file.yaml
echo task rc:x import file.yaml
printf "y\n" | task rc:x import file.yaml
echo task rc:x new limit:2
task rc:x new limit:2

# Help
echo Help
echo task rc:x help
task rc:x help
echo man task
#man task
echo man taskrc
#man taskrc
echo man task-color
#man task-color
echo man task-tutorial
#man task-tutorial
echo man task-faq
#man task-faq

# Wrap up
echo Wrap up
echo task rc:x version
task rc:x version

exit

