--- a/cline.c Thu Oct 20 15:21:53 2011 +0200 +++ b/cline.c Thu Oct 20 17:29:23 2011 +0200 @@ -54,14 +54,14 @@ int main(int argc, char** argv) { - // Settings + /* Settings */ settings_t *settings = new_settings_t(); if (settings == NULL) { fprintf(stderr, "Memory allocation failed.\n"); return 1; } - // Get arguments + /* Get arguments */ char* directory = "./"; char* suffix = " "; int checked = 0; @@ -70,7 +70,7 @@ int argflags = checkArgument(argv[t], "hsSrRmvVb"); - // s, S + /* s, S */ if ((argflags & 6) > 0) { if (registerArgument(&checked, 6)) { return exit_with_help(settings, 1); @@ -82,36 +82,36 @@ } suffix = argv[t]; } - // h + /* h */ if ((argflags & 1) > 0 || strcmp(argv[t], "--help") == 0) { return exit_with_help(settings, 0); } - // r, R + /* r, R */ if ((argflags & 24) > 0) { if (registerArgument(&checked, 24)) { return exit_with_help(settings, 1); } settings->recursive = true; } - // m + /* m */ if ((argflags & 32) > 0) { if (registerArgument(&checked, 32)) { return exit_with_help(settings, 1); } settings->matchesOnly = true; } - // v + /* v */ if ((argflags & 64) > 0 || strcmp(argv[t], "--version") == 0) { return exit_with_version(settings); } - // V + /* V */ if ((argflags & 128) > 0) { if (registerArgument(&checked, 128)) { return exit_with_help(settings, 1); } settings->verbose = false; } - // b + /* b */ if ((argflags & 256) > 0) { if (registerArgument(&checked, 256)) { return exit_with_help(settings, 1); @@ -132,7 +132,7 @@ return exit_with_help(settings, 1); } } - // Path + /* Path */ if (argflags == 0) { if (registerArgument(&checked, 1024)) { return exit_with_help(settings, 1); @@ -141,19 +141,19 @@ } } - // Configure output + /* Configure output */ if (!settings->verbose) { close_stdout(); } - // Find tokens + /* Find tokens */ char* finder = strtok(suffix, ","); while (finder != NULL) { add_string(settings->suffixList, finder); finder = strtok(NULL, ","); } - // Open directory + /* Open directory */ DIR *dir = opendir(directory); if (dir == NULL) { perror("Operation failed"); @@ -161,12 +161,12 @@ return 1; } - // Scan directory + /* Scan directory */ int lines = scanDirectory(dir, 0, directory, settings); closedir(dir); destroy_settings_t(settings); - // Print double line and line count + /* Print double line and line count */ for (int t = 0 ; t < 79 ; t++) { printf("="); }