- Modified man page to acknowledge import from file or URL.
- Changed FEATURE_URL from #if to #ifdef, for consistency.
- Modified import.url.t to accomodate a new URL for the test.
This commit is contained in:
Paul Beckingham 2011-01-09 23:05:01 -05:00
parent 77f26994a6
commit 10a69c4d3d
3 changed files with 9 additions and 11 deletions

View file

@ -133,7 +133,7 @@ Shows task database statistics.
.TP .TP
.B import \fIfile .B import \fIfile
Imports tasks from a variety of formats. Imports tasks in a variety of formats, from file or URL.
.TP .TP
.B export .B export

View file

@ -1272,7 +1272,7 @@ int handleImport (std::string& outs)
// Use the description as a file name. // Use the description as a file name.
std::string file = trim (context.task.get ("description")); std::string file = trim (context.task.get ("description"));
#if FEATURE_URL > 0 #ifdef FEATURE_URL
std::string tmpfile = ""; std::string tmpfile = "";
Uri uri (file); Uri uri (file);
uri.parse (); uri.parse ();
@ -1344,11 +1344,9 @@ int handleImport (std::string& outs)
case not_a_clue: /* to stop the compiler from complaining. */ break; case not_a_clue: /* to stop the compiler from complaining. */ break;
} }
#if FEATURE_URL > 0 #ifdef FEATURE_URL
if (tmpfile != "") if (tmpfile != "")
{
remove (tmpfile.c_str ()); remove (tmpfile.c_str ());
}
#endif #endif
} }
else else

View file

@ -38,7 +38,7 @@ if (open my $fh, '>', 'import.rc')
ok (-r 'import.rc', 'Created import.rc'); ok (-r 'import.rc', 'Created import.rc');
} }
my $output = qx{../src/task rc:import.rc import http://taskwarrior.org/attachments/download/216/import.txt}; my $output = qx{../src/task rc:import.rc import http://tasktools.org/import.txt};
like ($output, qr/Imported 2 tasks successfully, with 0 errors./, 'no errors'); like ($output, qr/Imported 2 tasks successfully, with 0 errors./, 'no errors');
$output = qx{../src/task rc:import.rc list}; $output = qx{../src/task rc:import.rc list};