diff --git a/src/CLI.cpp b/src/CLI.cpp index 8d5e3110a..c9d24d5fe 100644 --- a/src/CLI.cpp +++ b/src/CLI.cpp @@ -411,6 +411,12 @@ void CLI::analyze (bool parse /* = true */, bool strict /* = false */) } _args.push_back (a); + + if (a.hasTag ("CALENDAR")) + { + A cal ("argCal", "calendar"); + _args.push_back (cal); + } } if (context.config.getInteger ("debug.parser") >= 3) diff --git a/src/commands/CmdCalendar.cpp b/src/commands/CmdCalendar.cpp index bd5a946f6..0a5ead2dc 100644 --- a/src/commands/CmdCalendar.cpp +++ b/src/commands/CmdCalendar.cpp @@ -335,7 +335,11 @@ int CmdCalendar::execute (std::string& output) if (context.commands.find (report) == context.commands.end ()) throw std::string (STRING_ERROR_DETAILS); + // If the executable was "cal" or equivalent, replace it with "task". std::string executable = context.cli._args[0].attribute ("raw"); + std::string::size_type cal = executable.find ("cal"); + if (cal != std::string::npos) + executable = executable.substr (0, cal) + PACKAGE; std::vector args; args.push_back (executable);