From 1511c1fcfde372d9b6a284e9e9d24358ce2766ff Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Thu, 18 Jun 2009 20:42:12 -0400 Subject: [PATCH] Enhancments - aliases - Began implementation of aliases. All commented out for now. --- src/Cmd.cpp | 24 ++++++++++++++++++++++++ src/Cmd.h | 2 ++ 2 files changed, 26 insertions(+) diff --git a/src/Cmd.cpp b/src/Cmd.cpp index 46a9d5ccb..e0e285e72 100644 --- a/src/Cmd.cpp +++ b/src/Cmd.cpp @@ -160,6 +160,30 @@ void Cmd::load () } } } + +/* + // Now load the aliases. + foreach (i, all) + { + if (i->substr (0, 6) == "alias.") + { + std::string name = i->substr (6, std::string::npos); + std::string alias = context.config.get (name); + + // Make sure a custom report does not clash with a built-in + // command. + if (std::find (commands.begin (), commands.end (), report) != commands.end ()) + throw std::string ("Alias '") + name + + "' conflicts with built-in task command."; + + if (std::find (customReports.begin (), customReports.end (), report) != customReports.end ()) + throw std::string ("Alias '") + name + + "' conflicts with custom report."; + + aliases[name] = alias; + } + } +*/ } } diff --git a/src/Cmd.h b/src/Cmd.h index fab4a7053..73a95b75c 100644 --- a/src/Cmd.h +++ b/src/Cmd.h @@ -27,6 +27,7 @@ #ifndef INCLUDED_CMD #define INCLUDED_CMD +//#include #include #include #include "Cmd.h" @@ -55,6 +56,7 @@ private: private: std::vector commands; std::vector customReports; +// std::map aliases; }; #endif