Changeset 1561

Show
Ignore:
Timestamp:
01/23/10 06:12:19 (6 months ago)
Author:
marek
Message:

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

Location:
branches/batctl-0.2.x
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • branches/batctl-0.2.x/proc.c

    r1514 r1561  
    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 
     
    119119int handle_table(int argc, char **argv, char *file_path, void table_usage(void)) 
    120120{ 
    121         int optchar, read_opt = CLR_CONT_READ | USE_BAT_HOSTS; 
     121        int optchar, read_opt = USE_BAT_HOSTS; 
    122122 
    123         while ((optchar = getopt(argc, argv, "bhn")) != -1) { 
     123        while ((optchar = getopt(argc, argv, "hnw")) != -1) { 
    124124                switch (optchar) { 
    125                 case 'b': 
    126                         read_opt &= ~CLR_CONT_READ; 
    127                         break; 
    128125                case 'h': 
    129126                        table_usage(); 
     
    131128                case 'n': 
    132129                        read_opt &= ~USE_BAT_HOSTS; 
     130                        break; 
     131                case 'w': 
     132                        read_opt |= CLR_CONT_READ; 
    133133                        break; 
    134134                default: 
  • branches/batctl-0.2.x/sys.c

    r1509 r1561  
    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;