in reply to Tool for editing / viewing a TODO file.
A couple minor points.
Both of these have existing unixy conventions. I would suggest a minor change:$G{editor} = "emacs"; # editor to use $G{list_pager} = "less"; # output pager program
These follow unixy convention. That is, if EDITOR is not set, vi is supposed to be the fallback default for editor, while if PAGER is not set, more is supposed to be the fallback default for the pager. Since you probably should have these variables set to emacs and less, respectively, in your own environment for use with other programs anyway, this shouldn't actually affect your program's operation on your machine.$G{editor} = $ENV{EDITOR} || "vi"; # editor to use $G{list_pager} = $ENV{PAGER} || "more"; # output pager program
Further, you can completely get rid of the commandline options using a little shell trick:
or$ PAGER="mail -S \"TODO reminders\" me@domain.com" t -l
to use vi. This trick just sets an environment variable (that is exported) but resets it back to what it was, after the command is finished, leaving it unchanged in the parent process.$ EDITOR= t -e
With these minor changes, your program feels more part of the unix world, making it operate just like everything else. For example, if you have sudo set up, try "sudo -e /etc/inittab" - it will use your current EDITOR environment variable to launch an editor to modify the inittab. Or "crontab -e" - launches the same editor to modify your crontab entries. So why not "t -e"? :-)
To be honest, when I saw the CUFP on the Newest Nodes page, I thought there would be a "-a" (add) option and a "-r" option which would allow easy/fast ability to modify standard TODO files (such as one might find in module distributions). That would be really handy ;-)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Tool for editing / viewing a TODO file.
by superfrink (Curate) on Jan 26, 2006 at 03:45 UTC |