Skip to content

Instantly share code, notes, and snippets.

@CyberShadow
Created May 26, 2011 21:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save CyberShadow/994106 to your computer and use it in GitHub Desktop.
Save CyberShadow/994106 to your computer and use it in GitHub Desktop.
DustMite output - before
// Written in the D programming language.
import std.algorithm, std.c.stdlib, std.datetime, std.exception,
std.file, std.getopt,
std.md5, std.path, std.process, std.regexp,
std.stdio, std.string, std.array, std.typetuple;
private bool chatty, buildOnly, dryRun, force;
private string exe, compiler = "dmd";
int main(string[] args)
{
// Continue parsing the command line; now get rdmd's own arguments
// parse the -o option
void dashOh(string key, string value)
{
}
auto programPos = indexOfProgram(args);
// bailout set by functions called in getopt if
// program should exit
string[] loop; // set by --main
string[] eval; // set by --eval
getopt(args,
std.getopt.config.caseSensitive,
std.getopt.config.passThrough,
std.getopt.config.stopOnFirstNonOption,
"build-only", &buildOnly,
"chatty", &chatty,
"dry-run", &dryRun,
"force", &force,
"help", (string) { },
"eval", &eval,
"loop", &loop,
"o", &dashOh,
"compiler", &compiler);
const
root = /*rel2abs*/(chomp(args[programPos], ".d") ~ ".d"),
exeBasename = basename(root, ".d"),
exeDirname = dirname(root),
programArgs = args[programPos + 1 .. $];
{
//exe = exeBasename ~ '.' ~ hash(root, compilerFlags);
version (Posix)
exe = std.path.join(myOwnTmpDir, rel2abs(root)[1 .. $])
~ '.' ~ hash(root, compilerFlags);
else version (Windows)
exe = std.path.join(myOwnTmpDir, replace(root, ".", "-"))
~ '-' ~ hash(root, compilerFlags);
}
// Have at it
if (isNewer(root, exe) ||
std.algorithm.find!
((string a) {})
(myModules.keys).length)
{
}
}
size_t indexOfProgram(string[] args)
{
foreach(i, arg; args)
{
}
}
private string myOwnTmpDir()
{
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment