Changeset 1560

Show
Ignore:
Timestamp:
01/23/10 05:55:01 (8 months ago)
Author:
marek
Message:

batctl: make batch-mode the default and offer watch mode to deactivate it

Location:
trunk/batctl
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/batctl/proc.c

    r1541 r1560  
    7373        printf("Usage: batctl [options] originators \n"); 
    7474        printf("options:\n"); 
    75         printf(" \t -b batch mode - read the originator table once and quit\n"); 
    7675        printf(" \t -h print this help\n"); 
    7776        printf(" \t -n don't replace mac addresses with bat-host names\n"); 
     77        printf(" \t -w watch mode - refresh the originator table continuously\n"); 
    7878} 
    7979 
     
    8282        printf("Usage: batctl [options] translocal \n"); 
    8383        printf("options:\n"); 
    84         printf(" \t -b batch mode - read the local translation table once and quit\n"); 
    8584        printf(" \t -h print this help\n"); 
    8685        printf(" \t -n don't replace mac addresses with bat-host names\n"); 
     86        printf(" \t -w watch mode - refresh the local translation table continuously\n"); 
    8787} 
    8888 
     
    9191        printf("Usage: batctl [options] transglobal \n"); 
    9292        printf("options:\n"); 
    93         printf(" \t -b batch mode - read the global translation table once and quit\n"); 
    9493        printf(" \t -h print this help\n"); 
    9594        printf(" \t -n don't replace mac addresses with bat-host names\n"); 
     95        printf(" \t -w watch mode - refresh the global translation table continuously\n"); 
    9696} 
    9797 
     
    100100        printf("Usage: batctl [options] gw_srv_list \n"); 
    101101        printf("options:\n"); 
    102         printf(" \t -b batch mode - read the gateway server list once and quit\n"); 
    103102        printf(" \t -h print this help\n"); 
    104103        printf(" \t -n don't replace mac addresses with bat-host names\n"); 
     104        printf(" \t -w watch mode - refresh the gateway server list continuously\n"); 
    105105} 
    106106 
     
    135135int handle_table(int argc, char **argv, char *file_path, void table_usage(void)) 
    136136{ 
    137         int optchar, read_opt = CLR_CONT_READ | USE_BAT_HOSTS; 
     137        int optchar, read_opt = USE_BAT_HOSTS; 
    138138 
    139         while ((optchar = getopt(argc, argv, "bhn")) != -1) { 
     139        while ((optchar = getopt(argc, argv, "hnw")) != -1) { 
    140140                switch (optchar) { 
    141                 case 'b': 
    142                         read_opt &= ~CLR_CONT_READ; 
    143                         break; 
    144141                case 'h': 
    145142                        table_usage(); 
     
    147144                case 'n': 
    148145                        read_opt &= ~USE_BAT_HOSTS; 
     146                        break; 
     147                case 'w': 
     148                        read_opt |= CLR_CONT_READ; 
    149149                        break; 
    150150                default: 
  • trunk/batctl/sys.c

    r1509 r1560  
    3737        printf("Note: if no logfile was specified stdin is read"); 
    3838        printf("options:\n"); 
    39         printf(" \t -b batch mode - read the log file once and quit\n"); 
    4039        printf(" \t -h print this help\n"); 
    4140        printf(" \t -n don't replace mac addresses with bat-host names\n"); 
     41        printf(" \t -w watch mode - read the log file continuously\n"); 
    4242} 
    4343 
    4444int log_print(int argc, char **argv) 
    4545{ 
    46         int optchar, read_opt = CONT_READ | USE_BAT_HOSTS | LOG_MODE; 
     46        int optchar, read_opt = USE_BAT_HOSTS | LOG_MODE; 
    4747        int found_args = 1; 
    4848 
    49         while ((optchar = getopt(argc, argv, "bhn")) != -1) { 
     49        while ((optchar = getopt(argc, argv, "hnw")) != -1) { 
    5050                switch (optchar) { 
    51                 case 'b': 
    52                         read_opt &= ~CONT_READ; 
    53                         found_args += 1; 
    54                         break; 
    5551                case 'h': 
    5652                        log_usage(); 
     
    5854                case 'n': 
    5955                        read_opt &= ~USE_BAT_HOSTS; 
     56                        found_args += 1; 
     57                        break; 
     58                case 'w': 
     59                        read_opt |= CONT_READ; 
    6060                        found_args += 1; 
    6161                        break;