diff --git a/ChangeLog b/ChangeLog index c5320aadc..432cc6731 100644 --- a/ChangeLog +++ b/ChangeLog @@ -51,6 +51,7 @@ + Two new color themes (thanks to Kathryn Andersen). + More localized holiday files for US, CA, SE, DE, FR, UK, ES and NL (thanks to T. Charles Yun). + + Added new 'diagnostics' command to help with bug submission, testing. + Fixed bug #427, preventing the task edit command to parse annotation dates with spaces. + Fixed bug #433, making task command output more consistent. diff --git a/NEWS b/NEWS index 7ea0afb01..519b13934 100644 --- a/NEWS +++ b/NEWS @@ -40,6 +40,7 @@ New commands in taskwarrior 1.9.3 file from another taskwarrior user, to sync across machines, for example. - New 'task push ' command to distribute merged changes. - New 'task pull ' command to copy data files from a remote location. + - New 'diagnostics' command to aid bug reporting. New configuration options in taskwarrior 1.9.3 @@ -65,14 +66,13 @@ Newly deprecated features in taskwarrior 1.9.3 obsolete. The 'task show' command warns of the use of these deprecated fields. The synonyms will be removed in a future version of taskwarrior. - --- Taskwarrior has been built and tested on the following configurations: * OS X 10.6 Snow Leopard and 10.5 Leopard * Fedora 13 Goddard, 12 Constantine - * Ubuntu 10.04 Lucid Lynx, 9.10 Karmic Koala + * Ubuntu 10.10 Maverick Meerkat, 10.04 Lucid Lynx * Debian Sid * Slackware 12.2 * Arch Linux diff --git a/i18n/strings.en-US b/i18n/strings.en-US index fc95861f7..ce4da2ccf 100644 --- a/i18n/strings.en-US +++ b/i18n/strings.en-US @@ -61,6 +61,8 @@ 230 config 231 show +235 diagnostics + # 3xx Attributes - must be sequential 300 project 301 priority diff --git a/src/Cmd.cpp b/src/Cmd.cpp index ed18d4757..ef97101aa 100644 --- a/src/Cmd.cpp +++ b/src/Cmd.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006 - 2010, Paul Beckingham. +// Copyright 2006 - 2010, Paul Beckingham, Federico Hernandez. // All rights reserved. // // This program is free software; you can redistribute it and/or modify it under @@ -75,7 +75,8 @@ bool Cmd::valid (const std::string& input) // // To be a valid custom command: // 1. 'input' should autocomplete to one of 'commands'. -// 2. the result, canonicalized, should autocomplete to one of 'customreports'. +// 2. the result, canonicalized, should autocomplete to one of +// 'customreports'. bool Cmd::validCustom (const std::string& input) { load (); @@ -143,38 +144,39 @@ void Cmd::load () commands.push_back ("ghistory.annual"); // Commands whose names are localized. - commands.push_back (context.stringtable.get (CMD_ADD, "add")); - commands.push_back (context.stringtable.get (CMD_APPEND, "append")); - commands.push_back (context.stringtable.get (CMD_ANNOTATE, "annotate")); - commands.push_back (context.stringtable.get (CMD_DENOTATE, "denotate")); - commands.push_back (context.stringtable.get (CMD_CALENDAR, "calendar")); - commands.push_back (context.stringtable.get (CMD_COLORS, "colors")); - commands.push_back (context.stringtable.get (CMD_CONFIG, "config")); - commands.push_back (context.stringtable.get (CMD_SHOW, "show")); - commands.push_back (context.stringtable.get (CMD_DELETE, "delete")); - commands.push_back (context.stringtable.get (CMD_DONE, "done")); - commands.push_back (context.stringtable.get (CMD_DUPLICATE, "duplicate")); - commands.push_back (context.stringtable.get (CMD_EDIT, "edit")); - commands.push_back (context.stringtable.get (CMD_HELP, "help")); - commands.push_back (context.stringtable.get (CMD_IMPORT, "import")); - commands.push_back (context.stringtable.get (CMD_INFO, "info")); - commands.push_back (context.stringtable.get (CMD_LOG, "log")); - commands.push_back (context.stringtable.get (CMD_PREPEND, "prepend")); - commands.push_back (context.stringtable.get (CMD_PROJECTS, "projects")); + commands.push_back (context.stringtable.get (CMD_ADD, "add")); + commands.push_back (context.stringtable.get (CMD_APPEND, "append")); + commands.push_back (context.stringtable.get (CMD_ANNOTATE, "annotate")); + commands.push_back (context.stringtable.get (CMD_DENOTATE, "denotate")); + commands.push_back (context.stringtable.get (CMD_CALENDAR, "calendar")); + commands.push_back (context.stringtable.get (CMD_COLORS, "colors")); + commands.push_back (context.stringtable.get (CMD_CONFIG, "config")); + commands.push_back (context.stringtable.get (CMD_SHOW, "show")); + commands.push_back (context.stringtable.get (CMD_DELETE, "delete")); + commands.push_back (context.stringtable.get (CMD_DIAGNOSTICS, "diagnostics")); + commands.push_back (context.stringtable.get (CMD_DONE, "done")); + commands.push_back (context.stringtable.get (CMD_DUPLICATE, "duplicate")); + commands.push_back (context.stringtable.get (CMD_EDIT, "edit")); + commands.push_back (context.stringtable.get (CMD_HELP, "help")); + commands.push_back (context.stringtable.get (CMD_IMPORT, "import")); + commands.push_back (context.stringtable.get (CMD_INFO, "info")); + commands.push_back (context.stringtable.get (CMD_LOG, "log")); + commands.push_back (context.stringtable.get (CMD_PREPEND, "prepend")); + commands.push_back (context.stringtable.get (CMD_PROJECTS, "projects")); #ifdef FEATURE_SHELL - commands.push_back (context.stringtable.get (CMD_SHELL, "shell")); + commands.push_back (context.stringtable.get (CMD_SHELL, "shell")); #endif - commands.push_back (context.stringtable.get (CMD_START, "start")); - commands.push_back (context.stringtable.get (CMD_STATS, "stats")); - commands.push_back (context.stringtable.get (CMD_STOP, "stop")); - commands.push_back (context.stringtable.get (CMD_SUMMARY, "summary")); - commands.push_back (context.stringtable.get (CMD_TAGS, "tags")); - commands.push_back (context.stringtable.get (CMD_TIMESHEET, "timesheet")); - commands.push_back (context.stringtable.get (CMD_UNDO, "undo")); - commands.push_back (context.stringtable.get (CMD_VERSION, "version")); - commands.push_back (context.stringtable.get (CMD_MERGE, "merge")); - commands.push_back (context.stringtable.get (CMD_PUSH, "push")); - commands.push_back (context.stringtable.get (CMD_PULL, "pull")); + commands.push_back (context.stringtable.get (CMD_START, "start")); + commands.push_back (context.stringtable.get (CMD_STATS, "stats")); + commands.push_back (context.stringtable.get (CMD_STOP, "stop")); + commands.push_back (context.stringtable.get (CMD_SUMMARY, "summary")); + commands.push_back (context.stringtable.get (CMD_TAGS, "tags")); + commands.push_back (context.stringtable.get (CMD_TIMESHEET, "timesheet")); + commands.push_back (context.stringtable.get (CMD_UNDO, "undo")); + commands.push_back (context.stringtable.get (CMD_VERSION, "version")); + commands.push_back (context.stringtable.get (CMD_MERGE, "merge")); + commands.push_back (context.stringtable.get (CMD_PUSH, "push")); + commands.push_back (context.stringtable.get (CMD_PULL, "pull")); // Now load the custom reports. std::vector all; @@ -242,20 +244,21 @@ bool Cmd::isReadOnlyCommand () command == "history.annual" || command == "ghistory.monthly" || command == "ghistory.annual" || - command == context.stringtable.get (CMD_CALENDAR, "calendar") || - command == context.stringtable.get (CMD_COLORS, "colors") || - command == context.stringtable.get (CMD_CONFIG, "config") || - command == context.stringtable.get (CMD_SHOW, "show") || - command == context.stringtable.get (CMD_HELP, "help") || - command == context.stringtable.get (CMD_INFO, "info") || - command == context.stringtable.get (CMD_PROJECTS, "projects") || - command == context.stringtable.get (CMD_PUSH, "push") || - command == context.stringtable.get (CMD_SHELL, "shell") || - command == context.stringtable.get (CMD_STATS, "stats") || - command == context.stringtable.get (CMD_SUMMARY, "summary") || - command == context.stringtable.get (CMD_TAGS, "tags") || - command == context.stringtable.get (CMD_TIMESHEET, "timesheet") || - command == context.stringtable.get (CMD_VERSION, "version") || + command == context.stringtable.get (CMD_CALENDAR, "calendar") || + command == context.stringtable.get (CMD_COLORS, "colors") || + command == context.stringtable.get (CMD_DIAGNOSTICS, "diagnostics") || + command == context.stringtable.get (CMD_CONFIG, "config") || + command == context.stringtable.get (CMD_SHOW, "show") || + command == context.stringtable.get (CMD_HELP, "help") || + command == context.stringtable.get (CMD_INFO, "info") || + command == context.stringtable.get (CMD_PROJECTS, "projects") || + command == context.stringtable.get (CMD_PUSH, "push") || + command == context.stringtable.get (CMD_SHELL, "shell") || + command == context.stringtable.get (CMD_STATS, "stats") || + command == context.stringtable.get (CMD_SUMMARY, "summary") || + command == context.stringtable.get (CMD_TAGS, "tags") || + command == context.stringtable.get (CMD_TIMESHEET, "timesheet") || + command == context.stringtable.get (CMD_VERSION, "version") || validCustom (command)) return true; @@ -280,7 +283,7 @@ bool Cmd::isWriteCommand () command == context.stringtable.get (CMD_PREPEND, "prepend") || command == context.stringtable.get (CMD_PULL, "pull") || command == context.stringtable.get (CMD_START, "start") || - command == context.stringtable.get (CMD_STOP, "stop") || + command == context.stringtable.get (CMD_STOP, "stop") || command == context.stringtable.get (CMD_UNDO, "undo")) return true; diff --git a/src/Cmd.h b/src/Cmd.h index ddc8eaf7d..9e2d86d70 100644 --- a/src/Cmd.h +++ b/src/Cmd.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006 - 2010, Paul Beckingham. +// Copyright 2006 - 2010, Paul Beckingham, Federico Hernandez. // All rights reserved. // // This program is free software; you can redistribute it and/or modify it under diff --git a/src/Context.cpp b/src/Context.cpp index 2d9915efe..0af4d07e4 100644 --- a/src/Context.cpp +++ b/src/Context.cpp @@ -245,6 +245,7 @@ int Context::dispatch (std::string &out) handleMerge (out); } else if (cmd.command == "push") { handlePush (out); } else if (cmd.command == "pull") { handlePull (out); } + else if (cmd.command == "diagnostics") { handleDiagnostics (out); } else if (cmd.command == "_projects") { rc = handleCompletionProjects (out); } else if (cmd.command == "_tags") { rc = handleCompletionTags (out); } else if (cmd.command == "_commands") { rc = handleCompletionCommands (out); } diff --git a/src/Makefile.am b/src/Makefile.am index 6cf22affe..3203b4d00 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -13,9 +13,10 @@ task_SOURCES = API.cpp API.h Att.cpp Att.h Cmd.cpp Cmd.h Color.cpp Color.h \ Timer.cpp Timer.h Transport.cpp Transport.h TransportSSH.cpp \ TransportSSH.h TransportRSYNC.cpp TransportRSYNC.h \ TransportCurl.cpp TransportCurl.h Tree.cpp Tree.h command.cpp \ - custom.cpp dependency.cpp edit.cpp export.cpp i18n.h import.cpp \ - interactive.cpp main.cpp main.h recur.cpp report.cpp rules.cpp \ - rx.cpp rx.h text.cpp text.h util.cpp util.h Uri.cpp Uri.h + custom.cpp dependency.cpp diag.cpp edit.cpp export.cpp i18n.h \ + import.cpp interactive.cpp main.cpp main.h recur.cpp report.cpp \ + rules.cpp rx.cpp rx.h text.cpp text.h util.cpp util.h Uri.cpp \ + Uri.h task_CPPFLAGS=$(LUA_CFLAGS) task_LDFLAGS=$(LUA_LFLAGS) diff --git a/src/command.cpp b/src/command.cpp index dfb6e44a4..6791b9bef 100644 --- a/src/command.cpp +++ b/src/command.cpp @@ -52,7 +52,7 @@ extern Context context; //////////////////////////////////////////////////////////////////////////////// -int handleAdd (std::string &outs) +int handleAdd (std::string& outs) { int rc = 0; @@ -145,7 +145,7 @@ int handleAdd (std::string &outs) } //////////////////////////////////////////////////////////////////////////////// -int handleLog (std::string &outs) +int handleLog (std::string& outs) { int rc = 0; @@ -210,7 +210,7 @@ int handleLog (std::string &outs) } //////////////////////////////////////////////////////////////////////////////// -int handleProjects (std::string &outs) +int handleProjects (std::string& outs) { int rc = 0; @@ -313,7 +313,7 @@ int handleProjects (std::string &outs) } //////////////////////////////////////////////////////////////////////////////// -int handleCompletionProjects (std::string &outs) +int handleCompletionProjects (std::string& outs) { std::vector tasks; context.tdb.lock (context.config.getBoolean ("locking")); @@ -343,7 +343,7 @@ int handleCompletionProjects (std::string &outs) } //////////////////////////////////////////////////////////////////////////////// -int handleTags (std::string &outs) +int handleTags (std::string& outs) { int rc = 0; @@ -431,7 +431,7 @@ int handleTags (std::string &outs) } //////////////////////////////////////////////////////////////////////////////// -int handleCompletionTags (std::string &outs) +int handleCompletionTags (std::string& outs) { std::vector tasks; context.tdb.lock (context.config.getBoolean ("locking")); @@ -466,7 +466,7 @@ int handleCompletionTags (std::string &outs) } //////////////////////////////////////////////////////////////////////////////// -int handleCompletionCommands (std::string &outs) +int handleCompletionCommands (std::string& outs) { // Get a list of all commands. std::vector commands; @@ -484,7 +484,7 @@ int handleCompletionCommands (std::string &outs) } //////////////////////////////////////////////////////////////////////////////// -int handleCompletionConfig (std::string &outs) +int handleCompletionConfig (std::string& outs) { std::vector configs; context.config.all (configs); @@ -501,7 +501,7 @@ int handleCompletionConfig (std::string &outs) //////////////////////////////////////////////////////////////////////////////// // A simple version display for use by completion scripts and the task-update // script. -int handleCompletionVersion (std::string &outs) +int handleCompletionVersion (std::string& outs) { outs = VERSION; outs += "\n"; @@ -510,7 +510,7 @@ int handleCompletionVersion (std::string &outs) //////////////////////////////////////////////////////////////////////////////// // Temporary command to display urgency for a task. -int handleUrgency (std::string &outs) +int handleUrgency (std::string& outs) { // Get all the tasks. std::vector tasks; @@ -539,7 +539,7 @@ int handleUrgency (std::string &outs) } //////////////////////////////////////////////////////////////////////////////// -int handleCompletionIDs (std::string &outs) +int handleCompletionIDs (std::string& outs) { std::vector tasks; context.tdb.lock (context.config.getBoolean ("locking")); @@ -777,7 +777,7 @@ void handlePull (std::string& outs) } //////////////////////////////////////////////////////////////////////////////// -int handleVersion (std::string &outs) +int handleVersion (std::string& outs) { int rc = 0; @@ -866,7 +866,7 @@ int handleVersion (std::string &outs) } //////////////////////////////////////////////////////////////////////////////// -int handleShow (std::string &outs) +int handleShow (std::string& outs) { int rc = 0; @@ -1135,7 +1135,7 @@ int handleShow (std::string &outs) } //////////////////////////////////////////////////////////////////////////////// -int handleConfig (std::string &outs) +int handleConfig (std::string& outs) { int rc = 0; @@ -1259,7 +1259,7 @@ int handleConfig (std::string &outs) } //////////////////////////////////////////////////////////////////////////////// -int handleDelete (std::string &outs) +int handleDelete (std::string& outs) { int rc = 0; @@ -1392,7 +1392,7 @@ int handleDelete (std::string &outs) } //////////////////////////////////////////////////////////////////////////////// -int handleStart (std::string &outs) +int handleStart (std::string& outs) { int rc = 0; @@ -1458,7 +1458,7 @@ int handleStart (std::string &outs) } //////////////////////////////////////////////////////////////////////////////// -int handleStop (std::string &outs) +int handleStop (std::string& outs) { int rc = 0; @@ -1516,7 +1516,7 @@ int handleStop (std::string &outs) } //////////////////////////////////////////////////////////////////////////////// -int handleDone (std::string &outs) +int handleDone (std::string& outs) { int rc = 0; @@ -1624,7 +1624,7 @@ int handleDone (std::string &outs) } //////////////////////////////////////////////////////////////////////////////// -int handleModify (std::string &outs) +int handleModify (std::string& outs) { context.hooks.trigger ("pre-modify-command"); @@ -1755,7 +1755,7 @@ int handleModify (std::string &outs) } //////////////////////////////////////////////////////////////////////////////// -int handleAppend (std::string &outs) +int handleAppend (std::string& outs) { int rc = 0; @@ -1837,7 +1837,7 @@ int handleAppend (std::string &outs) } //////////////////////////////////////////////////////////////////////////////// -int handlePrepend (std::string &outs) +int handlePrepend (std::string& outs) { int rc = 0; @@ -1919,7 +1919,7 @@ int handlePrepend (std::string &outs) } //////////////////////////////////////////////////////////////////////////////// -int handleDuplicate (std::string &outs) +int handleDuplicate (std::string& outs) { int rc = 0; @@ -2088,7 +2088,7 @@ void handleShell () #endif //////////////////////////////////////////////////////////////////////////////// -int handleColor (std::string &outs) +int handleColor (std::string& outs) { int rc = 0; @@ -2301,7 +2301,7 @@ int handleColor (std::string &outs) } //////////////////////////////////////////////////////////////////////////////// -int handleAnnotate (std::string &outs) +int handleAnnotate (std::string& outs) { int rc = 0; @@ -2362,7 +2362,7 @@ int handleAnnotate (std::string &outs) } //////////////////////////////////////////////////////////////////////////////// -int handleDenotate (std::string &outs) +int handleDenotate (std::string& outs) { int rc = 0; diff --git a/src/custom.cpp b/src/custom.cpp index 774ba5702..c13a3b0c5 100644 --- a/src/custom.cpp +++ b/src/custom.cpp @@ -53,7 +53,7 @@ static std::vector customReports; //////////////////////////////////////////////////////////////////////////////// // This report will eventually become the one report that many others morph into // via the .taskrc file. -int handleCustomReport (const std::string& report, std::string &outs) +int handleCustomReport (const std::string& report, std::string& outs) { int rc = 0; diff --git a/src/diag.cpp b/src/diag.cpp new file mode 100644 index 000000000..76fa4fc20 --- /dev/null +++ b/src/diag.cpp @@ -0,0 +1,221 @@ +//////////////////////////////////////////////////////////////////////////////// +// taskwarrior - a command line task list manager. +// +// Copyright 2006 - 2010, Paul Beckingham, Federico Hernandez. +// All rights reserved. +// +// This program is free software; you can redistribute it and/or modify it under +// the terms of the GNU General Public License as published by the Free Software +// Foundation; either version 2 of the License, or (at your option) any later +// version. +// +// This program is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// this program; if not, write to the +// +// Free Software Foundation, Inc., +// 51 Franklin Street, Fifth Floor, +// Boston, MA +// 02110-1301 +// USA +// +//////////////////////////////////////////////////////////////////////////////// + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include "../auto.h" + +#ifdef HAVE_LIBLUA +extern "C" +{ + #include +} +#endif + +#ifdef HAVE_LIBNCURSES +#include +#endif + +extern Context context; + +//////////////////////////////////////////////////////////////////////////////// +// This command will generate output that is intended to help diagnose problems. +// +// Although this will change over time, initially this command will answer the +// kind of questions we always have to ask whenever something is wrong. +void handleDiagnostics (std::string& outs) +{ + std::cout << "\n" << PACKAGE_STRING << "\n"; + + std::cout << " Platform: " + << +#if defined (DARWIN) + "Darwin" +#elif defined (SOLARIS) + "Solaris" +#elif defined (CYGWIN) + "Cygwin" +#elif defined (OPENBSD) + "OpenBSD" +#elif defined (HAIKU) + "Haiku" +#elif defined (FREEBSD) + "FreeBSD" +#elif defined (LINUX) + "Linux" +#else + "" +#endif + << "\n\n"; + + // Compiler. + std::cout << "Compiler\n" +#ifdef __VERSION__ + << " Version: " << __VERSION__ << "\n" +#endif + << " Caps:" +#ifdef __STDC__ + << " +stdc" +#endif +#ifdef __STDC_HOSTED__ + << " +stdc_hosted" +#endif +#ifdef __STDC_VERSION__ + << " +" << __STDC_VERSION__ +#endif +#ifdef _POSIX_VERSION + << " +" << _POSIX_VERSION +#endif +#ifdef _POSIX2_C_VERSION + << " +" << _POSIX2_C_VERSION +#endif +#ifdef _ILP32 + << " +ILP32" +#endif +#ifdef _LP64 + << " +LP64" +#endif + << " +c" << sizeof (char) + << " +i" << sizeof (int) + << " +l" << sizeof (long) + << " +vp" << sizeof (void*) + << "\n\n"; + + std::cout << "Libraries\n"; + + // NCurses. + std::cout << " NCurses: " +#ifdef HAVE_LIBNCURSES + << NCURSES_VERSION + << " (" + << NCURSES_VERSION_PATCH + << ")" +#else + << "n/a" +#endif + << "\n"; + + std::cout << " Readline: " +#ifdef HAVE_LIBREADLINE + << std::setbase (16) << RL_READLINE_VERSION +#else + << "n/a" +#endif + << "\n"; + + std::cout << " Lua: " +#ifdef HAVE_LIBLUA + << LUA_RELEASE +#else + << "n/a" +#endif + << "\n\n"; + + std::cout << "Build Features\n" + // Build date. + << " Built: " << __DATE__ << " " << __TIME__ << "\n" + << " Caps:" +#ifdef HAVE_LIBPTHREAD + << " +pthreads" +#else + << " -pthreads" +#endif + +#ifdef HAVE_SRANDOM + << " +srandom" +#else + << " -srandom" +#endif + +#ifdef HAVE_RANDOM + << " +random" +#else + << " -random" +#endif + +#ifdef HAVE_UUID + << " +uuid" +#else + << " -uuid" +#endif + << "\n\n"; + + // Config: .taskrc found, readable, writable + std::cout << "Configuration\n" + << " File: " << context.config.original_file.data + << (context.config.original_file.exists () ? " (found)" : " (missing)") + << ", " << context.config.original_file.size () << " bytes" + << ", mode " + << std::setbase (8) + << context.config.original_file.mode () + << "\n"; + + // Config: data.location found, readable, writable + File location (context.config.get ("data.location")); + std::cout << " Data: " << location.data + << (location.exists () ? " (found)" : " (missing)") + << ", " << (location.is_directory () ? "dir" : "?") + << ", mode " + << std::setbase (8) + << location.mode () + << "\n\n"; + + // Generate 1000 UUIDs and verify they are all unique. + std::cout << "Tests\n"; + { + std::cout << " UUID gen: "; + std::vector uuids; + std::string id; + for (int i = 0; i < 1000; i++) + { + id = uuid (); + if (std::find (uuids.begin (), uuids.end (), id) != uuids.end ()) + { + std::cout << "Failed - duplicate UUID at iteration " << i << "\n"; + break; + } + else + uuids.push_back (id); + } + + if (uuids.size () >= 1000) + std::cout << "1000 unique UUIDs generated.\n"; + } + std::cout << "\n"; +} + +//////////////////////////////////////////////////////////////////////////////// + diff --git a/src/edit.cpp b/src/edit.cpp index fcf2cc366..d51de7324 100644 --- a/src/edit.cpp +++ b/src/edit.cpp @@ -626,7 +626,7 @@ ARE_THESE_REALLY_HARMFUL: // Introducing the Silver Bullet. This feature is the catch-all fixative for // various other ills. This is like opening up the hood and going in with a // wrench. To be used sparingly. -int handleEdit (std::string &outs) +int handleEdit (std::string& outs) { int rc = 0; diff --git a/src/export.cpp b/src/export.cpp index 6a5ef49df..5c59fda8b 100644 --- a/src/export.cpp +++ b/src/export.cpp @@ -38,7 +38,7 @@ extern Context context; //////////////////////////////////////////////////////////////////////////////// -int handleExportCSV (std::string &outs) +int handleExportCSV (std::string& outs) { int rc = 0; @@ -92,7 +92,7 @@ int handleExportCSV (std::string &outs) // http://tools.ietf.org/html/rfc5545 // // Note: Recurring tasks could be included in more detail. -int handleExportiCal (std::string &outs) +int handleExportiCal (std::string& outs) { int rc = 0; @@ -226,7 +226,7 @@ int handleExportiCal (std::string &outs) } //////////////////////////////////////////////////////////////////////////////// -int handleExportYAML (std::string &outs) +int handleExportYAML (std::string& outs) { int rc = 0; diff --git a/src/i18n.h b/src/i18n.h index 8a05e3083..c26731643 100644 --- a/src/i18n.h +++ b/src/i18n.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006 - 2010, Paul Beckingham. +// Copyright 2006 - 2010, Paul Beckingham, Federico Hernandez. // All rights reserved. // // This program is free software; you can redistribute it and/or modify it under @@ -101,6 +101,7 @@ #define CMD_MERGE 232 #define CMD_PUSH 233 #define CMD_PULL 234 +#define CMD_DIAGNOSTICS 235 // 3xx Attributes #define ATT_PROJECT 300 diff --git a/src/import.cpp b/src/import.cpp index 6b6a5ecdd..fad332586 100644 --- a/src/import.cpp +++ b/src/import.cpp @@ -1254,7 +1254,7 @@ static std::string importYAML (const std::vector & lines) } //////////////////////////////////////////////////////////////////////////////// -int handleImport (std::string &outs) +int handleImport (std::string& outs) { int rc = 0; diff --git a/src/main.h b/src/main.h index 04fd36674..bed021285 100644 --- a/src/main.h +++ b/src/main.h @@ -92,6 +92,9 @@ int deltaTags (Task&); int deltaAttributes (Task&); int deltaSubstitutions (Task&); +// diag.cpp +void handleDiagnostics (std::string&); + // edit.cpp int handleEdit (std::string&); diff --git a/src/report.cpp b/src/report.cpp index 6f9bfee15..cb07bc403 100644 --- a/src/report.cpp +++ b/src/report.cpp @@ -56,7 +56,7 @@ static void countTasks (const std::vector &, const std::string&, const std extern Context context; //////////////////////////////////////////////////////////////////////////////// -int shortUsage (std::string &outs) +int shortUsage (std::string& outs) { Table table; @@ -236,6 +236,10 @@ int shortUsage (std::string &outs) table.addCell (row, 1, "task config [name [value | '']]"); table.addCell (row, 2, "Add, modify and remove settings in the task configuration."); + row = table.addRow (); + table.addCell (row, 1, "task diagnostics"); + table.addCell (row, 2, "Information needed when reporting a problem."); + row = table.addRow (); table.addCell (row, 1, "task help"); table.addCell (row, 2, "Shows the long usage text."); @@ -269,7 +273,7 @@ int shortUsage (std::string &outs) } //////////////////////////////////////////////////////////////////////////////// -int longUsage (std::string &outs) +int longUsage (std::string& outs) { int rc = 0; @@ -351,7 +355,7 @@ int longUsage (std::string &outs) //////////////////////////////////////////////////////////////////////////////// // Display all information for the given task. -int handleInfo (std::string &outs) +int handleInfo (std::string& outs) { int rc = 0; @@ -660,7 +664,7 @@ int handleInfo (std::string &outs) // Project Remaining Avg Age Complete 0% 100% // A 12 13d 55% XXXXXXXXXXXXX----------- // B 109 3d 12h 10% XXX--------------------- -int handleReportSummary (std::string &outs) +int handleReportSummary (std::string& outs) { int rc = 0; @@ -848,7 +852,7 @@ time_t yearlyEpoch (const std::string& date) return 0; } -int handleReportHistoryMonthly (std::string &outs) +int handleReportHistoryMonthly (std::string& outs) { int rc = 0; @@ -1015,7 +1019,7 @@ int handleReportHistoryMonthly (std::string &outs) } //////////////////////////////////////////////////////////////////////////////// -int handleReportHistoryAnnual (std::string &outs) +int handleReportHistoryAnnual (std::string& outs) { int rc = 0; @@ -1179,7 +1183,7 @@ int handleReportHistoryAnnual (std::string &outs) } //////////////////////////////////////////////////////////////////////////////// -int handleReportGHistoryMonthly (std::string &outs) +int handleReportGHistoryMonthly (std::string& outs) { int rc = 0; @@ -1386,7 +1390,7 @@ int handleReportGHistoryMonthly (std::string &outs) } //////////////////////////////////////////////////////////////////////////////// -int handleReportGHistoryAnnual (std::string &outs) +int handleReportGHistoryAnnual (std::string& outs) { int rc = 0; @@ -1589,7 +1593,7 @@ int handleReportGHistoryAnnual (std::string &outs) } //////////////////////////////////////////////////////////////////////////////// -int handleReportTimesheet (std::string &outs) +int handleReportTimesheet (std::string& outs) { int rc = 0; @@ -2004,7 +2008,7 @@ std::string renderMonths ( } //////////////////////////////////////////////////////////////////////////////// -int handleReportCalendar (std::string &outs) +int handleReportCalendar (std::string& outs) { int rc = 0; @@ -2360,7 +2364,7 @@ int handleReportCalendar (std::string &outs) } //////////////////////////////////////////////////////////////////////////////// -int handleReportStats (std::string &outs) +int handleReportStats (std::string& outs) { int rc = 0;