diff --git a/ChangeLog b/ChangeLog index c8bf8b17c..c9f0cdaab 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,14 +1,10 @@ -Version numbers are of the form: - - X.Y.Z - -where the X represents a major version number, or architecture. The Y -represents a feature release, and the Z represents a patch. ------ current release --------------------------- 1.5.0 (?) + Removed deprecated TUTORIAL file. + + Removed "usage" command, and support for "command.logging" configuration + variable. ------ old releases ------------------------------ diff --git a/html/advanced.html b/html/advanced.html index 126bbf3a2..07f293754 100644 --- a/html/advanced.html +++ b/html/advanced.html @@ -313,19 +313,6 @@ ID Project Pri Description This command displays all the colors that task supports.

- % task usage -

- If logging has been enabled by the "command.logging=on" directive - in the .taskrc file, then task will record every command that is - run. When this command is run, task will display a count of how - many times each command was used. -

- -

- This command is for the purpose of seeing whether command are - actually used. -

- % task version

This can be used to show the version number of task, and to display diff --git a/html/config.html b/html/config.html index 251766af1..37cd127b8 100644 --- a/html/config.html +++ b/html/config.html @@ -51,13 +51,6 @@ /Users/paul/.task -

command.logging
-
- May be "on" or "off", defaulting to "off". This determines - whether task records commands. This is not generally useful, - except while developing task. -
-
confirmation
May be "yes" or "no", and determines whether task will ask for diff --git a/html/task.html b/html/task.html index 2d370c8fb..7609c422d 100644 --- a/html/task.html +++ b/html/task.html @@ -96,7 +96,9 @@

New in version 1.5.0 (?)

diff --git a/html/usage.html b/html/usage.html index 1a5b58d0a..97b98f5df 100644 --- a/html/usage.html +++ b/html/usage.html @@ -45,6 +45,7 @@ task info ID task start ID task done ID + task undo ID task projects task tags task summary @@ -57,7 +58,6 @@ task oldest task newest task stats - task usage task export task color task version diff --git a/src/Config.cpp b/src/Config.cpp index 6fe00db3a..81bfcb6d2 100644 --- a/src/Config.cpp +++ b/src/Config.cpp @@ -112,7 +112,6 @@ void Config::createDefault (const std::string& home) if ((out = fopen (rcFile.c_str (), "w"))) { fprintf (out, "data.location=%s\n", dataDir.c_str ()); - fprintf (out, "command.logging=off\n"); fprintf (out, "confirmation=yes\n"); fprintf (out, "next=2\n"); fprintf (out, "dateformat=m/d/Y\n"); diff --git a/src/TDB.cpp b/src/TDB.cpp index abb3812ae..dcced05af 100644 --- a/src/TDB.cpp +++ b/src/TDB.cpp @@ -37,7 +37,6 @@ TDB::TDB () : mPendingFile ("") , mCompletedFile ("") -, mLogFile ("") , mId (1) { } @@ -54,7 +53,6 @@ void TDB::dataDirectory (const std::string& directory) { mPendingFile = directory + "/pending.data"; mCompletedFile = directory + "/completed.data"; - mLogFile = directory + "/command.log"; } else { @@ -286,58 +284,6 @@ bool TDB::modifyT (const T& t) return overwritePending (pending); } -//////////////////////////////////////////////////////////////////////////////// -bool TDB::logRead (std::vector & entries) const -{ - entries.clear (); - return readLockedFile (mLogFile, entries); -} - -//////////////////////////////////////////////////////////////////////////////// -bool TDB::logCommand (int argc, char** argv) const -{ - // Get time info. - time_t now; - time (&now); - struct tm* t = localtime (&now); - - // Generate timestamp. - char timestamp[20]; - sprintf (timestamp, "%04d-%02d-%02d %02d:%02d:%02d", - t->tm_year + 1900, - t->tm_mon + 1, - t->tm_mday, - t->tm_hour, - t->tm_min, - t->tm_sec); - - std::string command = timestamp; - command += " \""; - for (int i = 0; i < argc; ++i) - command += std::string (i ? " " : "") + argv[i]; - command += "\"\n"; - - if (! access (mLogFile.c_str (), F_OK | W_OK)) - { - FILE* out; - if ((out = fopen (mLogFile.c_str (), "a"))) - { -#ifdef HAVE_FLOCK - int retry = 0; - while (flock (fileno (out), LOCK_EX) && ++retry <= 3) - delay (0.25); -#endif - - fputs (command.c_str (), out); - - fclose (out); - return true; - } - } - - return false; -} - //////////////////////////////////////////////////////////////////////////////// bool TDB::lock (FILE* file) const { diff --git a/src/TDB.h b/src/TDB.h index ccdeea788..9ceb9b3d8 100644 --- a/src/TDB.h +++ b/src/TDB.h @@ -48,7 +48,6 @@ public: bool addT (const T&) const; bool modifyT (const T&); bool logRead (std::vector &) const; - bool logCommand (int, char**) const; int gc (); int nextId (); @@ -62,7 +61,6 @@ private: private: std::string mPendingFile; std::string mCompletedFile; - std::string mLogFile; int mId; }; diff --git a/src/parse.cpp b/src/parse.cpp index c468a822c..bf835ac55 100644 --- a/src/parse.cpp +++ b/src/parse.cpp @@ -142,7 +142,6 @@ static const char* commands[] = "tags", "undelete", "undo", - "usage", "version", "", }; diff --git a/src/report.cpp b/src/report.cpp index c82abeaac..5c1d8ac8f 100644 --- a/src/report.cpp +++ b/src/report.cpp @@ -1594,81 +1594,6 @@ void handleReportGHistory (TDB& tdb, T& task, Config& conf) std::cout << "No tasks." << std::endl; } -//////////////////////////////////////////////////////////////////////////////// -// A summary of the command usage. Not useful to users, but used to display -// usage statistics for feedback. -// -// 2006-12-04 19:59:43 "task list" -// -void handleReportUsage (const TDB& tdb, T& task, Config& conf) -{ - if (conf.get ("command.logging") == "on") - { - std::map usage; - std::vector all; - tdb.logRead (all); - for (unsigned int i = 0; i < all.size (); ++i) - { - // 0123456789012345678901 - // v 21 - // 2006-12-04 19:59:43 "task list" - std::string command = all[i].substr (21, all[i].length () - 22); - - // Parse as a command line. - std::vector args; - split (args, command, " "); - - try - { - T task; - std::string commandName; - parse (args, commandName, task, conf); - - usage[commandName]++; - } - - // Deliberately ignore errors from parsing the command log, as there may - // be commands from a prior version of task in there, which were - // abbreviated, and are now ambiguous. - catch (...) {} - } - - // Now render the table. - Table table; - table.addColumn ("Command"); - table.addColumn ("Frequency"); - - if (conf.get ("color", true)) - { - table.setColumnUnderline (0); - table.setColumnUnderline (1); - } - else - table.setTableDashedUnderline (); - - table.setColumnJustification (1, Table::right); - table.sortOn (1, Table::descendingNumeric); - table.setDateFormat (conf.get ("dateformat", "m/d/Y")); - - foreach (i, usage) - { - int row = table.addRow (); - table.addCell (row, 0, (i->first == "" ? "(modify)" : i->first)); - table.addCell (row, 1, i->second); - } - - if (table.rowCount ()) - std::cout << optionalBlankLine (conf) - << table.render () - << std::endl; - else - std::cout << "No usage." << std::endl; - } - else - std::cout << "Command logging is not enabled, so no history has been kept." - << std::endl; -} - //////////////////////////////////////////////////////////////////////////////// std::string renderMonths ( int firstMonth, diff --git a/src/task.cpp b/src/task.cpp index 29951dee3..e53f9675f 100644 --- a/src/task.cpp +++ b/src/task.cpp @@ -178,10 +178,6 @@ static void shortUsage (Config& conf) table.addCell (row, 1, "task stats"); table.addCell (row, 2, "Shows task database statistics"); - row = table.addRow (); - table.addCell (row, 1, "task usage"); - table.addCell (row, 2, "Shows task command usage frequency"); - row = table.addRow (); table.addCell (row, 1, "task export"); table.addCell (row, 2, "Exports all tasks as a CSV file"); @@ -296,10 +292,6 @@ int main (int argc, char** argv) TDB tdb; tdb.dataDirectory (expandPath (conf.get ("data.location"))); - // Log commands, if desired. - if (conf.get ("command.logging") == "on") - tdb.logCommand (argc, argv); - // If argc == 1 and the default.command configuration variable is set, // then use that, otherwise stick with argc/argv. std::vector args; @@ -347,7 +339,6 @@ int main (int argc, char** argv) else if (command == "oldest") handleReportOldest (tdb, task, conf); else if (command == "newest") handleReportNewest (tdb, task, conf); else if (command == "stats") handleReportStats (tdb, task, conf); - else if (command == "usage") handleReportUsage (tdb, task, conf); else if (command == "" && task.getId ()) handleModify (tdb, task, conf); else if (command == "help") longUsage (conf); else shortUsage (conf); diff --git a/src/task.h b/src/task.h index 7b732f423..9c417435b 100644 --- a/src/task.h +++ b/src/task.h @@ -92,7 +92,6 @@ void handleReportSummary (TDB&, T&, Config&); void handleReportNext (TDB&, T&, Config&); void handleReportHistory (TDB&, T&, Config&); void handleReportGHistory (TDB&, T&, Config&); -void handleReportUsage (const TDB&, T&, Config&); void handleReportCalendar (TDB&, T&, Config&); void handleReportActive (TDB&, T&, Config&); void handleReportOverdue (TDB&, T&, Config&);