Show
Ignore:
Timestamp:
07/29/08 21:30:55 (4 months ago)
Author:
karpet
Message:

add -v option

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • libswish3/trunk/src/swish_lint.c

    r2140 r2149  
    3232 
    3333int debug = 0; 
     34int verbose = 0; 
    3435 
    3536int main( 
     
    5657    {"help", no_argument, 0, 'h'}, 
    5758    {"tokenize3", no_argument, 0, 't'}, 
     59    {"verbose", no_argument, 0, 'v'}, 
    5860    {0, 0, 0, 0} 
    5961}; 
     
    8183    char *descr = "swish_lint is an example program for using libswish3\n"; 
    8284    printf("swish_lint [opts] [- | file(s)]\n"); 
    83     printf("opts:\n --config conf_file.xml\n --debug [lvl]\n --help\n"); 
     85    printf("opts:\n --config conf_file.xml\n --debug [lvl]\n --help\n --verbose\n"); 
    8486    printf("\n%s\n", descr); 
    8587    printf("Debugging env vars:\n"); 
     
    127129        swish_debug_docinfo(parser_data->docinfo); 
    128130 
    129     if (SWISH_DEBUG & SWISH_DEBUG_WORDLIST) { 
     131    if (SWISH_DEBUG & SWISH_DEBUG_WORDLIST 
     132        || verbose 
     133    ) { 
    130134      if (parser_data->s3->analyzer->tokenlist) { 
    131135        swish_debug_token_list(parser_data->token_iterator); 
     
    163167    s3 = swish_init_swish3(&handler, NULL); 
    164168 
    165     while ((ch = getopt_long(argc, argv, "c:d:f:ht", longopts, &option_index)) != -1) { 
     169    while ((ch = getopt_long(argc, argv, "c:d:f:htv", longopts, &option_index)) != -1) { 
    166170 
    167171        switch (ch) { 
     
    195199            break; 
    196200             
     201        case 'v': 
     202            verbose = 1; 
     203            break; 
     204             
    197205        case '?': 
    198206        case 'h':