diff --git a/src/Config.cpp b/src/Config.cpp index b527867b3..1edd2328b 100644 --- a/src/Config.cpp +++ b/src/Config.cpp @@ -308,7 +308,7 @@ std::string Config::defaults = "alias.rm=delete # Alias for the delete command\n" "alias.history=history.monthly # Prefer monthly over annual history reports\n" "alias.ghistory=ghistory.monthly # Prefer monthly graphical over annual history reports\n" - "alias.export=_query # Prefer JSON as the prime format\n" + "alias._query=export # _query is now export\n" "alias.export.vcalendar=export.ical # They are the same\n" "alias.export.json=_query # The _query command will be used for all export\n" "alias.burndown=burndown.weekly # Prefer the weekly burndown chart\n" diff --git a/src/commands/CMakeLists.txt b/src/commands/CMakeLists.txt index 8bcffd3fc..9ac751536 100644 --- a/src/commands/CMakeLists.txt +++ b/src/commands/CMakeLists.txt @@ -23,6 +23,7 @@ set (commands_SRCS Command.cpp Command.h CmdDuplicate.cpp CmdDuplicate.h CmdEdit.cpp CmdEdit.h CmdExec.cpp CmdExec.h + CmdExport.cpp CmdExport.h CmdHelp.cpp CmdHelp.h CmdHistory.cpp CmdHistory.h CmdIDs.cpp CmdIDs.h @@ -37,7 +38,6 @@ set (commands_SRCS Command.cpp Command.h CmdProjects.cpp CmdProjects.h CmdPull.cpp CmdPull.h CmdPush.cpp CmdPush.h - CmdQuery.cpp CmdQuery.h CmdReports.cpp CmdReports.h CmdShell.cpp CmdShell.h CmdShow.cpp CmdShow.h diff --git a/src/commands/CmdQuery.cpp b/src/commands/CmdExport.cpp similarity index 92% rename from src/commands/CmdQuery.cpp rename to src/commands/CmdExport.cpp index 50695c749..829714a02 100644 --- a/src/commands/CmdQuery.cpp +++ b/src/commands/CmdExport.cpp @@ -30,22 +30,22 @@ #include #include #include -#include +#include extern Context context; //////////////////////////////////////////////////////////////////////////////// -CmdQuery::CmdQuery () +CmdExport::CmdExport () { - _keyword = "_query"; - _usage = "task _query []"; - _description = STRING_CMD_QUERY_USAGE; + _keyword = "export"; + _usage = "task export []"; + _description = STRING_CMD_EXPORT_USAGE; _read_only = true; _displays_id = true; } //////////////////////////////////////////////////////////////////////////////// -int CmdQuery::execute (std::string& output) +int CmdExport::execute (std::string& output) { int rc = 0; diff --git a/src/commands/CmdQuery.h b/src/commands/CmdExport.h similarity index 92% rename from src/commands/CmdQuery.h rename to src/commands/CmdExport.h index df0a7f112..06b5e6716 100644 --- a/src/commands/CmdQuery.h +++ b/src/commands/CmdExport.h @@ -24,17 +24,17 @@ // USA // //////////////////////////////////////////////////////////////////////////////// -#ifndef INCLUDED_CMDQUERY -#define INCLUDED_CMDQUERY +#ifndef INCLUDED_CMDEXPORT +#define INCLUDED_CMDEXPORT #define L10N // Localization complete. #include #include -class CmdQuery : public Command +class CmdExport : public Command { public: - CmdQuery (); + CmdExport (); int execute (std::string&); }; diff --git a/src/commands/CmdHelp.cpp b/src/commands/CmdHelp.cpp index 5d6108737..f4acd8053 100644 --- a/src/commands/CmdHelp.cpp +++ b/src/commands/CmdHelp.cpp @@ -90,6 +90,20 @@ int CmdHelp::execute (std::string& output) } } + // Add the aliases commands. + row = view.addRow (); + view.set (row, 1, " "); + + std::map ::iterator alias; + for (alias = context.aliases.begin (); + alias != context.aliases.end (); + ++alias) + { + row = view.addRow (); + view.set (row, 1, alias->first); + view.set (row, 2, "Aliased to '" + alias->second + "'"); + } + /* row = view.addRow (); view.set (row, 1, "task ID /from/to/g"); diff --git a/src/commands/CmdModify.cpp b/src/commands/CmdModify.cpp index dac6f69d5..b4cfe6344 100644 --- a/src/commands/CmdModify.cpp +++ b/src/commands/CmdModify.cpp @@ -40,8 +40,8 @@ extern Context context; CmdModify::CmdModify () { _keyword = "modify"; - _usage = "task modify \n" - "task "; + _usage = "task modify \n" + "task "; _description = "Modifies the existing task with provided arguments.\n" "The 'modify' keyword is optional."; _read_only = false; diff --git a/src/commands/Command.cpp b/src/commands/Command.cpp index a805a2ed3..f6e58bfd7 100644 --- a/src/commands/Command.cpp +++ b/src/commands/Command.cpp @@ -54,6 +54,7 @@ #include #include #include +#include #include #include #include @@ -68,7 +69,6 @@ #include #include #include -#include #include #include #include @@ -117,6 +117,7 @@ void Command::factory (std::map & all) c = new CmdDuplicate (); all[c->keyword ()] = c; c = new CmdEdit (); all[c->keyword ()] = c; c = new CmdExec (); all[c->keyword ()] = c; + c = new CmdExport (); all[c->keyword ()] = c; c = new CmdGHistoryMonthly (); all[c->keyword ()] = c; c = new CmdGHistoryAnnual (); all[c->keyword ()] = c; c = new CmdHelp (); all[c->keyword ()] = c; @@ -134,7 +135,6 @@ void Command::factory (std::map & all) c = new CmdProjects (); all[c->keyword ()] = c; c = new CmdPull (); all[c->keyword ()] = c; c = new CmdPush (); all[c->keyword ()] = c; - c = new CmdQuery (); all[c->keyword ()] = c; c = new CmdReports (); all[c->keyword ()] = c; c = new CmdShell (); all[c->keyword ()] = c; c = new CmdShow (); all[c->keyword ()] = c; diff --git a/src/en-US.h b/src/en-US.h index 2867c9fa9..527203f96 100644 --- a/src/en-US.h +++ b/src/en-US.h @@ -182,7 +182,7 @@ #define STRING_CMD_IDS_USAGE_RANGE "Shows only the IDs of matching tasks, in the form of a range." #define STRING_CMD_IDS_USAGE_LIST "Shows only the IDs of matching tasks, in the form of a list." #define STRING_CMD_IDS_USAGE_ZSH "Shows the IDs and descriptions of matching tasks." -#define STRING_CMD_QUERY_USAGE "Executes external commands and scripts" +#define STRING_CMD_EXPORT_USAGE "Executes external commands and scripts" #define STRING_CMD_INFO_USAGE "Shows all data and metadata for specified tasks." #define STRING_CMD_INFO_BLOCKED "This task blocked by" #define STRING_CMD_INFO_BLOCKING "This task is blocking"