- Fixed bug #406 so that task now includes command aliases in the _commands
  helper command used by shell completion scripts.
This commit is contained in:
Paul Beckingham 2010-05-31 11:40:42 -04:00
parent 24085e0960
commit 8cd8c4753b
3 changed files with 10 additions and 0 deletions

View file

@ -8,6 +8,8 @@
by using the 'log' command in place of 'add' (thanks to Cory Donnelly).
+ Added features #36 and #37, providing annual versions of the 'history'
and 'ghistory' command as 'history.annual' and 'ghistory.annual'.
+ Fixed bug #406 so that task now includes command aliases in the _commands
helper command used by shell completion scripts.
------ old releases ------------------------------

1
NEWS
View file

@ -17,6 +17,7 @@ New Features in task 1.9
substitutions in the description and annotations.
- New 'log' command to add tasks that are already completed.
- New annual history and ghistory command variations.
- Alias support in shell completion scripts.
- Task is now part of Debian
Please refer to the ChangeLog file for full details. There are too many to

View file

@ -424,8 +424,15 @@ int handleCompletionTags (std::string &outs)
////////////////////////////////////////////////////////////////////////////////
int handleCompletionCommands (std::string &outs)
{
// Get a list of all commands.
std::vector <std::string> commands;
context.cmd.allCommands (commands);
// Concatenate a list of all aliases.
foreach (name, context.aliases)
commands.push_back (name->first);
// Sort alphabetically.
std::sort (commands.begin (), commands.end ());
std::stringstream out;