mirror of
https://github.com/dlang/tools.git
synced 2025-04-25 20:51:00 +03:00
Fix whitespace
This commit is contained in:
parent
44e843e8bd
commit
ae655c8020
2 changed files with 43 additions and 43 deletions
54
catdoc.d
54
catdoc.d
|
@ -16,51 +16,51 @@ int main(string[] args)
|
|||
{
|
||||
if (args.length < 2)
|
||||
{
|
||||
writeln("catdoc: Concatenate Ddoc files
|
||||
writeln("catdoc: Concatenate Ddoc files
|
||||
Usage:
|
||||
catdoc -o=outputfile sourcefiles...
|
||||
");
|
||||
return 1;
|
||||
return 1;
|
||||
}
|
||||
|
||||
string ofile;
|
||||
getopt(args, "o", &ofile);
|
||||
if (!ofile.ptr)
|
||||
{
|
||||
writeln("catdoc: set output file with -o=filename");
|
||||
return 1;
|
||||
writeln("catdoc: set output file with -o=filename");
|
||||
return 1;
|
||||
}
|
||||
if (args.length < 2)
|
||||
{
|
||||
writeln("catdoc: no input files");
|
||||
return 1;
|
||||
writeln("catdoc: no input files");
|
||||
return 1;
|
||||
}
|
||||
|
||||
string comment = "Ddoc\n";
|
||||
string macros;
|
||||
foreach (arg; args[1..$])
|
||||
{
|
||||
//writeln(arg);
|
||||
string input = cast(string)std.file.read(arg);
|
||||
if (input.length < 4 || input[0..4] != "Ddoc")
|
||||
{ writefln("catdoc: %s is not a Ddoc file", arg);
|
||||
return 1;
|
||||
}
|
||||
foreach (i, c; input)
|
||||
{
|
||||
if (c == '\n')
|
||||
{
|
||||
if (i + 8 < input.length && std.string.icmp(input[i + 1 .. i + 8], "Macros:") == 0)
|
||||
{
|
||||
comment ~= input[4 .. i + 1];
|
||||
if (!macros.ptr)
|
||||
macros = "Macros:\n";
|
||||
macros ~= input[i + 8 .. $];
|
||||
goto L1;
|
||||
}
|
||||
}
|
||||
}
|
||||
comment ~= input[4 .. $];
|
||||
//writeln(arg);
|
||||
string input = cast(string)std.file.read(arg);
|
||||
if (input.length < 4 || input[0..4] != "Ddoc")
|
||||
{ writefln("catdoc: %s is not a Ddoc file", arg);
|
||||
return 1;
|
||||
}
|
||||
foreach (i, c; input)
|
||||
{
|
||||
if (c == '\n')
|
||||
{
|
||||
if (i + 8 < input.length && std.string.icmp(input[i + 1 .. i + 8], "Macros:") == 0)
|
||||
{
|
||||
comment ~= input[4 .. i + 1];
|
||||
if (!macros.ptr)
|
||||
macros = "Macros:\n";
|
||||
macros ~= input[i + 8 .. $];
|
||||
goto L1;
|
||||
}
|
||||
}
|
||||
}
|
||||
comment ~= input[4 .. $];
|
||||
L1: ;
|
||||
}
|
||||
|
||||
|
|
|
@ -150,9 +150,9 @@ int main(string[] args)
|
|||
removeDir(outputDir);
|
||||
copyDir(curlDir, outputDir);
|
||||
|
||||
writeln("Done.");
|
||||
writeln("Your OPTLINK-compatable libcurl.lib, along with the rest of libcurl,");
|
||||
writeln("is in the directory: ", outputDir);
|
||||
writeln("Done.");
|
||||
writeln("Your OPTLINK-compatable libcurl.lib, along with the rest of libcurl,");
|
||||
writeln("is in the directory: ", outputDir);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue