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