Commands
- Migrated the _version command from handleCompletionVersion to CmdVersion.
This commit is contained in:
@@ -30,6 +30,7 @@
|
||||
#include <Context.h>
|
||||
#include <ViewText.h>
|
||||
#include <cmake.h>
|
||||
#include <commit.h>
|
||||
#include <CmdVersion.h>
|
||||
|
||||
extern Context context;
|
||||
@@ -117,3 +118,27 @@ int CmdVersion::execute (const std::string& command_line, std::string& output)
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
CmdCompletionVersion::CmdCompletionVersion ()
|
||||
{
|
||||
_keyword = "_version";
|
||||
_usage = "task _version";
|
||||
_description = "Shows only the taskwarrior version number.";
|
||||
_read_only = true;
|
||||
_displays_id = false;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
int CmdCompletionVersion::execute (
|
||||
const std::string& command_line,
|
||||
std::string& output)
|
||||
{
|
||||
#ifdef HAVE_COMMIT
|
||||
output = COMMIT;
|
||||
#else
|
||||
output = VERSION;
|
||||
#endif
|
||||
output += "\n";
|
||||
return 0;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
Reference in New Issue
Block a user