Commit d6d9d306 authored by Cassio Kirch's avatar Cassio Kirch

Print help or parameters

parent 84cafcbb
......@@ -102,3 +102,8 @@ FILE* initializeFinalConfigurationFile()
return finalConfigurationFile;
}
void
printParameters()
{
putParametersToFile(stdout);
}
#include "boid.h"
FILE* initializeSingleFile ();
FILE* initializeStepAndTypeFile (const unsigned long long int step, \
......@@ -11,3 +12,5 @@ FILE* initializeFinalConfigurationFile();
void setDate ();
char* getDate();
void printParameters();
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "define.h"
#include "comp_errors.h"
......@@ -28,6 +29,7 @@ getGamma (const struct Boid* const boids)
}
while(boidCount != 0);
#ifdef DEBUG
for (boidCount = endoBoids; boidCount < N; ++boidCount)
if (boids[boidCount].type == ENDODERM)
......@@ -44,12 +46,15 @@ one_system ()
struct Box box[BOXES];
unsigned int boidCount, boxID, threadCount;
unsigned long long int step, continuousStep = 0;
//FILE* dat = initializeSingleFile();
FILE* finalConfigurationFile;
#ifdef PLOT_EXIT_FILES
FILE* endoFile;
FILE* ectoFile;
#endif
#ifdef GAMMA_FILE
FILE* gammaFile = initializeGammaFile();
#endif
......@@ -148,14 +153,32 @@ one_system ()
fclose (finalConfigurationFile);
}
void
printHelp()
{
printf("-h\t" "Show this help menu.\n");
printf("-p\t" "Show the parameters compiled.\n");
}
int
main ()
main (int argc, char** argv)
{
int returned = checkParameters();
if (returned != 0)
return returned;
setDate();
srand(time(NULL));
one_system();
if (argc > 1u)
{
if (strcmp(argv[1], "-p") == 0)
printParameters();
else
printHelp();
}
else
{
int returned = checkParameters();
if (returned != 0)
return returned;
setDate();
srand(time(NULL));
one_system();
}
return 0;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment