Enhancments - aliases
- Began implementation of aliases. All commented out for now.
This commit is contained in:
24
src/Cmd.cpp
24
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -27,6 +27,7 @@
|
|||||||
#ifndef INCLUDED_CMD
|
#ifndef INCLUDED_CMD
|
||||||
#define INCLUDED_CMD
|
#define INCLUDED_CMD
|
||||||
|
|
||||||
|
//#include <map>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include "Cmd.h"
|
#include "Cmd.h"
|
||||||
@@ -55,6 +56,7 @@ private:
|
|||||||
private:
|
private:
|
||||||
std::vector <std::string> commands;
|
std::vector <std::string> commands;
|
||||||
std::vector <std::string> customReports;
|
std::vector <std::string> customReports;
|
||||||
|
// std::map <std::string, std::string> aliases;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user