mirror of
https://github.com/GothenburgBitFactory/taskshell.git
synced 2025-07-27 12:16:28 +02:00
Diagnostics
- Implemented the start of the diagnostics command.
This commit is contained in:
parent
1480e54986
commit
71e1d226a2
1 changed files with 20 additions and 3 deletions
23
src/diag.cpp
23
src/diag.cpp
|
@ -26,7 +26,10 @@
|
||||||
|
|
||||||
#include <cmake.h>
|
#include <cmake.h>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
#include <string>
|
||||||
|
#include <vector>
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
|
#include <File.h>
|
||||||
#include <i18n.h>
|
#include <i18n.h>
|
||||||
#include <text.h>
|
#include <text.h>
|
||||||
|
|
||||||
|
@ -38,13 +41,27 @@
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
int cmdDiagnostics ()
|
int cmdDiagnostics ()
|
||||||
{
|
{
|
||||||
std::cout << "tasksh diagnostics\n";
|
|
||||||
|
|
||||||
// TODO Version
|
// TODO Version
|
||||||
// TODO Platform
|
// TODO Platform
|
||||||
// TODO pthreads
|
// TODO pthreads
|
||||||
// TODO libreadline
|
// TODO libreadline
|
||||||
// TODO Taskwarrior version + location
|
|
||||||
|
// Taskwarrior version + location
|
||||||
|
std::string path (getenv ("PATH"));
|
||||||
|
std::cout << "PATH " << path << "\n";
|
||||||
|
|
||||||
|
std::vector <std::string> paths;
|
||||||
|
split (paths, path, ':');
|
||||||
|
|
||||||
|
std::vector <std::string>::iterator i;
|
||||||
|
for (i = paths.begin (); i != paths.end (); ++i)
|
||||||
|
{
|
||||||
|
File task (*i + "/task");
|
||||||
|
if (task.exists ())
|
||||||
|
{
|
||||||
|
std::cout << "Taskwarrior " << (*i + "/task") << "\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue