+
+
+const struct option long_options[]={
+ {"help", 0,NULL,'h'},
+
+
+ {"print_level", 1,NULL,'p'},
+ {"quiet", 0,NULL,'q'},
+
+ {"seed", 1,NULL,'s'},
+
+ {"verbose", 0,NULL,'v'}
+};
+
+const char short_options[]="hp:qs:v";
+
+
+void init(int argc, char *argv[])
+{
+ char dir[200];
+ dir[0]='\0';
+ int x=-1;
+ char message[100];
+ int new_option;
+
+ x=(unsigned)time(NULL);
+ sprintf(message,"seeding srand with: %d\n",x);
+ print_message(2,message);
+ srand(x);
+
+
+
+ do {
+ new_option=getopt_long(argc,argv,short_options,long_options,NULL);
+ if (new_option=='h'){
+ printf("mirror_tests help\n");
+ printf("arguments:\n");
+ printf("\t-p [NUMBER] //sets the print level for mirror_tests.\n");
+ printf("\t-v //verbose mode everything is printed\n");
+ printf("\t-q //quiet mode nothing is printed.\n");
+ printf("\t-s [number] //seeds rand with the number\n");
+
+ exit(0);
+
+ } else if (new_option=='p'){
+ set_print_level(atoi(optarg));
+ } else if (new_option=='v'){
+ set_print_level(5);
+ } else if (new_option=='q'){
+ set_print_level(-1);
+ } else if (new_option=='s'){
+ srand(atoi(argv[x+1]));
+
+ } else if (new_option==-1){
+
+ } else if (new_option=='?') {
+ printf("bad argument\n");
+ exit(0);
+ }
+ }while(new_option!=-1);
+}
+
+int main(int argc, char *argv[])