diff --git a/html/import.html b/html/import.html index aee543927..35e9ec83f 100644 --- a/html/import.html +++ b/html/import.html @@ -34,6 +34,30 @@

Data Import

+

+ Tasks can be imported from files with this command: + +

% task import file
+ + A variety of different file types are recognized by task, namely: + + + + Task makes a good effort to determine which of these formats a + file is, and then imports accordingly. +

+ +

+ It would be wise to backup your task data files before an import. +


diff --git a/src/import.cpp b/src/import.cpp index be3dab21e..0dc2ba4a8 100644 --- a/src/import.cpp +++ b/src/import.cpp @@ -240,8 +240,13 @@ std::string handleImport (TDB& tdb, T& task, Config& conf) std::vector 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;