Calendar
- If the program is renamed 'cal' or 'calendar', or symlinked to either 'cal' or 'calendar', then the calendar report is run.
This commit is contained in:
@@ -168,7 +168,7 @@ void Arguments::capture (int argc, const char** argv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
// Append a pair with a category of "".
|
// Append a Triple with a blank category.
|
||||||
void Arguments::capture (const std::string& arg)
|
void Arguments::capture (const std::string& arg)
|
||||||
{
|
{
|
||||||
std::vector <std::string> parts;
|
std::vector <std::string> parts;
|
||||||
@@ -185,7 +185,7 @@ void Arguments::capture (const std::string& arg)
|
|||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
// Prepend a pair with a category of "".
|
// Prepend a Triple with a blank category.
|
||||||
void Arguments::capture_first (const std::string& arg)
|
void Arguments::capture_first (const std::string& arg)
|
||||||
{
|
{
|
||||||
// Break the new argument into parts that comprise a series.
|
// Break the new argument into parts that comprise a series.
|
||||||
@@ -289,6 +289,17 @@ void Arguments::categorize ()
|
|||||||
else if (arg == this->begin ())
|
else if (arg == this->begin ())
|
||||||
{
|
{
|
||||||
arg->_third = "program"; // TODO Is this a problem for expressions that do not contain a program name?
|
arg->_third = "program"; // TODO Is this a problem for expressions that do not contain a program name?
|
||||||
|
|
||||||
|
if (arg->_first == "cal" ||
|
||||||
|
arg->_first == "calendar" ||
|
||||||
|
arg->_first.find ("/calendar") == arg->_first.length () - 9 ||
|
||||||
|
arg->_first.find ("/cal") == arg->_first.length () - 4)
|
||||||
|
{
|
||||||
|
arg->_first = "calendar";
|
||||||
|
arg->_third = "command";
|
||||||
|
found_command = true;
|
||||||
|
found_non_sequence = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// command
|
// command
|
||||||
|
|||||||
@@ -120,6 +120,7 @@ int Context::initialize (int argc, const char** argv)
|
|||||||
Column::factory (columns);
|
Column::factory (columns);
|
||||||
|
|
||||||
// Categorize all arguments one more time.
|
// Categorize all arguments one more time.
|
||||||
|
// TODO This may not be necessary.
|
||||||
args.categorize ();
|
args.categorize ();
|
||||||
|
|
||||||
// Handle default command and assumed 'info' command.
|
// Handle default command and assumed 'info' command.
|
||||||
|
|||||||
Reference in New Issue
Block a user