/[jscoverage]/trunk/main.c
ViewVC logotype

Diff of /trunk/main.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 174 by siliconforks, Sat Sep 20 23:27:14 2008 UTC revision 311 by siliconforks, Mon Oct 13 17:51:29 2008 UTC
# Line 30  Line 30 
30  #include "util.h"  #include "util.h"
31    
32  const char * jscoverage_encoding = "ISO-8859-1";  const char * jscoverage_encoding = "ISO-8859-1";
33    bool jscoverage_highlight = true;
34    
35  int main(int argc, char ** argv) {  int main(int argc, char ** argv) {
36    int verbose = 0;    int verbose = 0;
# Line 52  Line 53 
53        exit(EXIT_SUCCESS);        exit(EXIT_SUCCESS);
54      }      }
55      else if (strcmp(argv[i], "-V") == 0 || strcmp(argv[i], "--version") == 0) {      else if (strcmp(argv[i], "-V") == 0 || strcmp(argv[i], "--version") == 0) {
56        printf("jscoverage %s\n", VERSION);        version();
       exit(EXIT_SUCCESS);  
57      }      }
58      else if (strcmp(argv[i], "-v") == 0 || strcmp(argv[i], "--verbose") == 0) {      else if (strcmp(argv[i], "-v") == 0 || strcmp(argv[i], "--verbose") == 0) {
59        verbose = 1;        verbose = 1;
60      }      }
61        else if (strcmp(argv[i], "--no-highlight") == 0) {
62          jscoverage_highlight = false;
63        }
64      else if (strcmp(argv[i], "--no-instrument") == 0) {      else if (strcmp(argv[i], "--no-instrument") == 0) {
65        i++;        i++;
66        if (i == argc) {        if (i == argc) {
67          fatal("--no-instrument: option requires an argument");          fatal_command_line("--no-instrument: option requires an argument");
68        }        }
69        no_instrument[num_no_instrument] = argv[i];        no_instrument[num_no_instrument] = argv[i];
70        num_no_instrument++;        num_no_instrument++;
# Line 73  Line 76 
76      else if (strcmp(argv[i], "--exclude") == 0) {      else if (strcmp(argv[i], "--exclude") == 0) {
77        i++;        i++;
78        if (i == argc) {        if (i == argc) {
79          fatal("--exclude: option requires an argument");          fatal_command_line("--exclude: option requires an argument");
80        }        }
81        exclude[num_exclude] = argv[i];        exclude[num_exclude] = argv[i];
82        num_exclude++;        num_exclude++;
# Line 85  Line 88 
88      else if (strcmp(argv[i], "--encoding") == 0) {      else if (strcmp(argv[i], "--encoding") == 0) {
89        i++;        i++;
90        if (i == argc) {        if (i == argc) {
91          fatal("--encoding: option requires an argument");          fatal_command_line("--encoding: option requires an argument");
92        }        }
93        jscoverage_encoding = argv[i];        jscoverage_encoding = argv[i];
94      }      }
# Line 93  Line 96 
96        jscoverage_encoding = argv[i] + 11;        jscoverage_encoding = argv[i] + 11;
97      }      }
98      else if (strncmp(argv[i], "-", 1) == 0) {      else if (strncmp(argv[i], "-", 1) == 0) {
99        fatal("unrecognized option `%s'", argv[i]);        fatal_command_line("unrecognized option `%s'", argv[i]);
100      }      }
101      else if (source == NULL) {      else if (source == NULL) {
102        source = argv[i];        source = argv[i];
# Line 102  Line 105 
105        destination = argv[i];        destination = argv[i];
106      }      }
107      else {      else {
108        fatal("too many arguments");        fatal_command_line("too many arguments");
109      }      }
110    }    }
111    
112    if (source == NULL || destination == NULL) {    if (source == NULL || destination == NULL) {
113      fatal("missing argument");      fatal_command_line("missing argument");
114    }    }
115    
116    source = make_canonical_path(source);    source = make_canonical_path(source);

Legend:
Removed from v.174  
changed lines
  Added in v.311

  ViewVC Help
Powered by ViewVC 1.1.24