- Set up structure for AUTHORS file.

- Set up NEWS file, with pleas for feedback.
- Added welcome message to README.
- Completed a chunk of the TUTORIAL.
- Added error handling for "task export" when a file name is not specified.
This commit is contained in:
Paul Beckingham 2008-05-18 00:30:12 -04:00
parent 04da56193e
commit b34cb90709
5 changed files with 259 additions and 82 deletions

View file

@ -2353,34 +2353,38 @@ void handleDone (const TDB& tdb, T& task, Config& conf)
void handleExport (const TDB& tdb, T& task, Config& conf)
{
std::string file = trim (task.getDescription ());
std::ofstream out (file.c_str ());
if (out.good ())
if (file.length () > 0)
{
out << "'id',"
<< "'status',"
<< "'tags',"
<< "'entry',"
<< "'start',"
<< "'due',"
<< "'end',"
<< "'project',"
<< "'priority',"
<< "'fg',"
<< "'bg',"
<< "'description'"
<< "\n";
std::vector <T> all;
tdb.allT (all);
foreach (t, all)
std::ofstream out (file.c_str ());
if (out.good ())
{
out << t->composeCSV ().c_str ();
out << "'id',"
<< "'status',"
<< "'tags',"
<< "'entry',"
<< "'start',"
<< "'due',"
<< "'end',"
<< "'project',"
<< "'priority',"
<< "'fg',"
<< "'bg',"
<< "'description'"
<< "\n";
std::vector <T> all;
tdb.allT (all);
foreach (t, all)
{
out << t->composeCSV ().c_str ();
}
out.close ();
}
out.close ();
else
throw std::string ("Could not write to export file.");
}
else
throw std::string ("Could not write to export file.");
throw std::string ("You must specify a file to write to.");
}
////////////////////////////////////////////////////////////////////////////////