2007-02-03 * Moved all functionality from the main case statement to individual functions. * Added the command import for importing todos in mass. Each line of input is added as a new todo. 2007-02-02 * Added support for completing multiple todo items at once. * Added the command undo for marking completed items as not done. * Made priority coloring simpler and expandable. New priority colors can be added by simply adding the color definition to the configuration file. There is no longer a need to edit todo.sh to make them work. 2007-01-17 * Terms used in listing can be negated by prefixing the term with the character '-'. This applies to list, listall and listdone. * Fixed bug with history, it wrote a history even if $HISTORY was set to 0. * Removed the -i option from all sed commands since it is not portable. * Will ask to create configuration if existing configuration can not be found. Will create the directory $HOME/.todo/ and place the configuration in $HOME/.todo/todorc. 2007-01-09 * Added the commands listcontexts and listprojects to list contexts and projects in todo.txt file respectively. These may be abbreviated to lsc and lc for listcontexts; lspr and lpr for listprojects. * Removed the line 'shopt -s extglob'. It does not seem to do anything and it can cause warnings on real bourne shells. Changes from original version: * General changes: Each task has a unique ID. The ID is an alphanumeric code similar to that used on hiveminder.com. The next ID is stored in the file as defined by the variable $ID_FILE in the .todo file and defaults to id.txt if the variable is not set. See the functions encode_id and decode_id for details of how the ID works. The unique ID is for the following two changes. The ID defaults to AA but can be set to any starting value. See the source. Added a history ability. Each action that adds or changes a todo is recorded in the file defined by the variable $HIST_FILE in the .todo file and defaults to history.txt if the variable is not set. History is only recorded if the variable $HISTORY is set to a true value in the .todo file or the command line opton -H is used. The history can be accessed via the history command. See bellow for information on the history command. Added the ability to comment on a todo. Comments are stored in a file named after the ID of the todo and are stored in the directory defined by the variable $COMMENT_DIR in the .todo file and defaults to comments is the variable is not set. Each time a comment is added a blank line followed by a timestamp then the comment is appended to the comment file. If a todo item has a comment a ! will be appened to it's line when listed. See bellow for more information on the comment command. Added a color option for completed items. Set the variable $DONE in the .todo file. Defaults to nothing. If the output is not to a terminal colors are turned off. Use the command line option -c to force the use of colors. Created the function print_todos. This function prints the todos piped/redirected to it. This reduces the complexity of the code and makes it easier to alter the behavior of todo printing. In addition sorting is now done in a more sane manner. Items that have no priority have a dummy priority of _ added so the listing can be sorted by priority and then by ID. After sorting and coloring the dummy priority is removed. See the comments above the function for more details. The priorityis now assumed to be immediately after a todo's ID. The prepend command will no longer break this. This assumption was already made in a few places but could be broken by the prepend command. Keep this in mind when editing, see below for the edit command, or replacing a todo. Added wildcards so only the first unique letters of a command have to be used. Also added shorter aliases for a few commands. todo.sh will look for it's configuration file based on it's own name. Everything up to the fist period will be used. So if it is renamed or linked to as note.sh it will look for ~/.note, ~/.note/noterc and ~/.noterc as it's configuration file. If ~/.todo is a directory todo.sh will look inside it for the file todorc. If found it will use that as the configuration file. The configuration file can also be named ~/.todorc. The command line option -d will always override this. The script migrate.sh will not do this. Altered color generation. Since "echo -e" is not portable. The complete escape sequence is expected to be present in the color variables. This is easily done by adding "ESC=`echo "" | tr '\n' '\033'`" before the color variables and replacing "\\033" with "$ESC". The script migrate.sh will take care of this if the -u option is specified. Fixed the command line option -q so it force verbosity to be off even if VERBOSE=1 is set in the configuration file. * Altered commands: + del|rm: Will also delete comments made on the todo being deleted. + prepend: Will keep the priority at the start of the todo right after it's ID. + pri: If a priority is not speicified then any priority assigned to that todo is removed. + remdup: Now prints an error stating it no longer does anything. * New commands: + edit: Edits a todo using the editor defined in $EDITOR or /usr/bin/vi. Multiple lines are compressed to one line. Spaces replace line endings. + comment: Adds a comment to a todo. The comment can appear on the command line. If there is no comment on the command line then the editor defined in $EDITOR or /usr/bin/vi is started. The entire text from the editor is appended unchanged to the comment file. + show: Displays comments on a todo. If no todo is specified diplays each todo from todo.txt that has comments followed by the comments on that todo. + help: Displays the same information as the -h command line option. + history: Displays information from the history file. With no options displays the entire history file. With # and a todo's ID it displays the history for that todo. With a date it displays the history for that date, the day is optional but the year and month are required for it to be seen as a date. Dates must be formatted as YYYY-MM-DD. With the word today displays the history for the current date. With just a number it displays that many lines from the end of the history file. + listdone: Lists the todo's in done.txt instead of todo.txt. Uses the same options as list.