Search the web
Sign In
New User? Sign Up
todotxt · Todo.txt
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Show off your group to the world. Share a photo of your group with us.

Best of Y! Groups

   Check them out and nominate your group.

Messages

  Messages Help
Advanced
HACK: A framework for plugging user-defined commands into the todo.s   Message List  
Reply Message #1739 of 2482 |
I've been moving my organizational system to todo.sh and love it,
especially now that I'm working on two different platforms (my desktop
is a Dell running Windows XP, and I do a lot of mobile work on an old
G3 iBook). In an effort to generate something I needed (a list of
projects) from my todo.txt file, I've hacked up a version of the
script that allows user-defined commands (in any language, but my
"projects" command was written in Perl), and created a minimal bit of
framework for writing extensions.

The curious can download my patch from:

http://www.tammycravit.com/todotxt_extended_cmds.patch.txt

Here's how it works:

Extended commands go in the directory $HOME/.todo.actions.d and may be
scripts in whatever language you'd like. The file must be named the
same as the command you're defining, and it must be marked executable.
(To hide my Perl support library, I've made it so that only executable
files.) The extended command must support two methods of invocation:

- The "todo.sh -h" command will invoke each extended command with the
single command-line argument "-usage". In this case, your extended
command must return usage information in a suitable format for the
command list generated by todo.sh -h.

- In all other cases, the extended command will simply be handed the
rest of what the user typed after the command name (in a Perl script,
you'll get this in @ARGV; in a shell script, in $*; and so forth). The
command should then do whatever it's supposed to do.

This is still a very rough initial version, so I haven't packaged up a
neat-and-tidy distribution of the script with these changes. Comments,
enhancements, etc. are welcome and encouraged; however, please send
those to tammy@... so they don't get lost in the sea of
list traffic I receive each day.

Warmly,
Tammy




Fri Oct 17, 2008 2:19 am

warmfuzzygrrl
Offline Offline
Send Email Send Email

Message #1739 of 2482 |
Expand Messages Author Sort by Date

I've been moving my organizational system to todo.sh and love it, especially now that I'm working on two different platforms (my desktop is a Dell running...
Tammy
warmfuzzygrrl
Offline Send Email
Oct 17, 2008
2:19 am

Tammy, That's a really nice idea. It's inclusive and encourages contributions. Good work. Paul. ... Actually, it just adds "usage", not "-usage"....
Paul Beckingham
p.beckingham
Offline Send Email
Oct 17, 2008
2:43 am
Advanced

Copyright © 2010 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help