diff --git a/src/Cmd.cpp b/src/Cmd.cpp index e3da9f670..37f8f3959 100644 --- a/src/Cmd.cpp +++ b/src/Cmd.cpp @@ -134,6 +134,7 @@ void Cmd::load () commands.push_back ("_ids"); commands.push_back ("_config"); commands.push_back ("_version"); + commands.push_back ("_sha1"); commands.push_back ("_urgency"); commands.push_back ("_query"); commands.push_back ("_zshcommands"); @@ -243,6 +244,7 @@ bool Cmd::isReadOnlyCommand () command == "_ids" || command == "_config" || command == "_version" || + command == "_sha1" || command == "_urgency" || command == "_query" || command == "_zshcommands" || diff --git a/src/Context.cpp b/src/Context.cpp index ed155cb9a..f3c55e148 100644 --- a/src/Context.cpp +++ b/src/Context.cpp @@ -269,6 +269,7 @@ int Context::dispatch (std::string &out) else if (cmd.command == "_ids") { rc = handleCompletionIDs (out); } else if (cmd.command == "_config") { rc = handleCompletionConfig (out); } else if (cmd.command == "_version") { rc = handleCompletionVersion (out); } + else if (cmd.command == "_sha1") { rc = handleSha1 (out); } else if (cmd.command == "_urgency") { rc = handleUrgency (out); } else if (cmd.command == "_query") { rc = handleQuery (out); } else if (cmd.command == "_zshcommands") { rc = handleZshCompletionCommands (out); } diff --git a/src/command.cpp b/src/command.cpp index 2a8e9e222..1931960fb 100644 --- a/src/command.cpp +++ b/src/command.cpp @@ -529,6 +529,20 @@ int handleCompletionVersion (std::string& outs) return 0; } +//////////////////////////////////////////////////////////////////////////////// +// A simple SHA1 display for use during development to identify which task +// version one is running. +int handleSha1 (std::string& outs) +{ +#ifdef HAVE_COMMIT + outs = COMMIT; +#else + outs = "No SHA1 available"; +#endif + outs += "\n"; + return 0; +} + //////////////////////////////////////////////////////////////////////////////// // Temporary command to display urgency for a task. int handleUrgency (std::string& outs) diff --git a/src/main.h b/src/main.h index 2ff0caacd..d5153af7d 100644 --- a/src/main.h +++ b/src/main.h @@ -67,6 +67,7 @@ int handleCompletionCommands (std::string&); int handleCompletionIDs (std::string&); int handleCompletionConfig (std::string&); int handleCompletionVersion (std::string&); +int handleSha1 (std::string&); int handleUrgency (std::string&); int handleQuery (std::string&); int handleZshCompletionCommands (std::string&);