From 77ba7946f53e30087ab19daad909295eaa6611c7 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sun, 3 Apr 2011 19:41:19 -0400 Subject: [PATCH] Code Cleanup - Removed conditional compilation of the shell, controlled by FEATURE_SHELL. --- src/Cmd.cpp | 2 -- src/Context.cpp | 2 -- src/command.cpp | 7 +------ src/main.h | 3 --- src/report.cpp | 2 -- 5 files changed, 1 insertion(+), 15 deletions(-) diff --git a/src/Cmd.cpp b/src/Cmd.cpp index 5de65fae0..ca1fd583d 100644 --- a/src/Cmd.cpp +++ b/src/Cmd.cpp @@ -168,9 +168,7 @@ void Cmd::load () commands.push_back ("log"); commands.push_back ("prepend"); commands.push_back ("projects"); -#ifdef FEATURE_SHELL commands.push_back ("shell"); -#endif commands.push_back ("start"); commands.push_back ("stats"); commands.push_back ("stop"); diff --git a/src/Context.cpp b/src/Context.cpp index 4389647a7..04ae0cdfd 100644 --- a/src/Context.cpp +++ b/src/Context.cpp @@ -282,9 +282,7 @@ int Context::dispatch (std::string &out) else if (cmd.command == "import") { rc = handleImport (out); } else if (cmd.command == "duplicate") { rc = handleDuplicate (out); } else if (cmd.command == "edit") { rc = handleEdit (out); } -#ifdef FEATURE_SHELL else if (cmd.command == "shell") { handleShell ( ); } -#endif else if (cmd.command == "undo") { handleUndo ( ); } else if (cmd.command == "merge") { tdb.gc (); handleMerge (out); } diff --git a/src/command.cpp b/src/command.cpp index 9e3388e85..8d46e35e0 100644 --- a/src/command.cpp +++ b/src/command.cpp @@ -1182,10 +1182,7 @@ int handleShow (std::string& outs) "active.indicator tag.indicator recurrence.indicator recurrence.limit " "list.all.projects list.all.tags undo.style verbose rule.precedence.color " "merge.autopush merge.default.uri pull.default.uri push.default.uri " - "xterm.title " -#ifdef FEATURE_SHELL - "shell.prompt " -#endif + "xterm.title shell.prompt " "import.synonym.status import.synonym.tags import.synonym.entry " "import.synonym.start import.synonym.due import.synonym.recur " "import.synonym.end import.synonym.project import.synonym.priority " @@ -2429,7 +2426,6 @@ int handleIds (std::string& outs) } //////////////////////////////////////////////////////////////////////////////// -#ifdef FEATURE_SHELL void handleShell () { if (context.hooks.trigger ("pre-shell-command")) @@ -2508,7 +2504,6 @@ void handleShell () context.hooks.trigger ("post-shell-command"); } } -#endif //////////////////////////////////////////////////////////////////////////////// int handleColor (std::string& outs) diff --git a/src/main.h b/src/main.h index 2ee0db5e8..180158e31 100644 --- a/src/main.h +++ b/src/main.h @@ -29,7 +29,6 @@ #define FEATURE_TDB_OPT 1 // TDB Optimization reduces file I/O. #define FEATURE_NEW_ID 1 // Echoes back new id. -#define FEATURE_SHELL 1 // Interactive shell. #define FEATURE_URL 1 // URL support for import. // (always enabled for merge/push/pull) //#define FEATURE_REGEX 1 // Enables regexes for attribute modifiers, @@ -88,9 +87,7 @@ void handleUndo (); void handleMerge (std::string&); void handlePush (std::string&); void handlePull (std::string&); -#ifdef FEATURE_SHELL void handleShell (); -#endif int deltaAppend (Task&); int deltaPrepend (Task&); int deltaDescription (Task&); diff --git a/src/report.cpp b/src/report.cpp index f073f882f..76f9847e9 100644 --- a/src/report.cpp +++ b/src/report.cpp @@ -121,11 +121,9 @@ int shortUsage (std::string& outs) table.addCell (row, 1, "task undo"); table.addCell (row, 2, "Reverts the most recent action."); -#ifdef FEATURE_SHELL row = table.addRow (); table.addCell (row, 1, "task shell"); table.addCell (row, 2, "Launches an interactive shell."); -#endif row = table.addRow (); table.addCell (row, 1, "task duplicate ID [tags] [attrs] [desc...]");