BUG: Custom commands should actually generate the files they claim to generate.

This commit is contained in:
Brad King 2006-06-02 12:19:16 -04:00
parent 886c559518
commit e1c110d244
2 changed files with 15 additions and 3 deletions

View File

@ -1,7 +1,17 @@
#include <stdio.h>
int main()
int main(int argc, const char* argv[])
{
printf("Hello\n");
FILE* fout = fopen(argv[argc-1], "w");
printf("Wrap creating \"%s\"\n", argv[argc-1]);
if(fout)
{
fprintf(fout, "int foo() { return 0; }\n");
fclose(fout);
}
else
{
return -1;
}
return 0;
}

View File

@ -4,8 +4,10 @@ int main(int ac, char** av)
{
for(int i =0; i < ac; ++i)
{
if(strcmp(av[i], "-o") == 0)
if(strcmp(av[i], "-o") == 0 ||
strcmp(av[i], "-h") == 0)
{
fprintf(stdout, "fakefluid is creating file \"%s\"\n", av[i+1]);
FILE* file = fopen(av[i+1], "w");
fprintf(file, "// hello\n");
fclose(file);