mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-23 05:27:47 +02:00
Updated Documentation
- Added description of import process.
This commit is contained in:
parent
e4f5d6579c
commit
c1291dc587
2 changed files with 30 additions and 1 deletions
|
@ -34,6 +34,30 @@
|
|||
<br />
|
||||
<h2 class="title">Data Import</h2>
|
||||
<div class="content">
|
||||
<p>
|
||||
Tasks can be imported from files with this command:
|
||||
|
||||
<pre><code>% task import file</code></pre>
|
||||
|
||||
A variety of different file types are recognized by task, namely:
|
||||
|
||||
<ul>
|
||||
<li>Tasks exported from task prior to version 1.5.0.
|
||||
<li>Tasks exported from task version 1.5.0 and later. The file
|
||||
format changed with 1.5.0.
|
||||
<li>todo.sh files.
|
||||
<li>CSV files with a variety of recognized column names.
|
||||
<li>Plain text files, with one task listed per line.
|
||||
<li>Task command line format.
|
||||
</ul>
|
||||
|
||||
Task makes a good effort to determine which of these formats a
|
||||
file is, and then imports accordingly.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
It would be wise to backup your task data files before an import.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<br />
|
||||
|
|
|
@ -240,8 +240,13 @@ std::string handleImport (TDB& tdb, T& task, Config& conf)
|
|||
std::vector <std::string> lines;
|
||||
slurp (file, lines, true);
|
||||
|
||||
// Take a guess at the file type.
|
||||
fileType type = determineFileType (lines);
|
||||
|
||||
// TODO Allow an override.
|
||||
|
||||
// Determine which type it might be, then attempt an import.
|
||||
switch (determineFileType (lines))
|
||||
switch (type)
|
||||
{
|
||||
case task_1_4_3: out << importTask_1_4_3 (tdb, conf, lines); break;
|
||||
case task_1_5_0: out << importTask_1_5_0 (tdb, conf, lines); break;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue