pkamenarsky / atea

A minimalistic menu bar time tracker for MacOS
612 stars 24 forks source link

add a task using bash script #19

Open ecarter opened 12 years ago

ecarter commented 12 years ago

Very minor but I've found it useful while trying out Atea as a daily todo app.

Usage:

tasks.sh -a "[github] Contribute to Atea project - 5m"

I currently have tasks.sh in my PATH with task-add aliased to tasks.sh -a

Great project!

pkamenarsky commented 12 years ago

That's a cool idea - but what happens if I do it this way:

tasks.sh -o -a "asdasd"

Nothing gets added! That's why I wanted to switch to getopts or whatever the bash parsing thing is called so that random-order arguments are possible: https://github.com/pkamenarsky/atea/issues/5

Glad you like Atea! :)

ecarter commented 12 years ago

Agreed, this is definitely not a fully implemented solution in the current pull request.

I'll take a look at updating this to support multiple flags. The functionality seems expected and shouldn't be much trouble.

There's a lot of potential in a robust Atea shell tool.

pkamenarsky commented 12 years ago

Agreed, a good shell script would definitely aid a lot in automating things even further.

When / if Atea gets support for configurable todo file syntax,I guess it would also be possible to use the todo.txt cli shell script.

databyte commented 12 years ago

I using zsh and have this:

export TODO=~/Dropbox/Documents/todo.txt
function todo() { if [ $# -eq 0 ]; then cat $TODO; else echo "$@" >> $TODO; fi }
function todone() { sed -i -e "/$*/d" $TODO; }

I'm sure it could be fancier but this works for me.

todo          # lists all current tasks
todo testing  # adds testing
todone test   # marks anything starting with test as done