Author: marek Date: 2010-01-23 05:55:01 +0100 (Sat, 23 Jan 2010) New Revision: 1560
Modified: trunk/batctl/proc.c trunk/batctl/sys.c Log: batctl: make batch-mode the default and offer watch mode to deactivate it
Modified: trunk/batctl/proc.c =================================================================== --- trunk/batctl/proc.c 2010-01-20 18:25:36 UTC (rev 1559) +++ trunk/batctl/proc.c 2010-01-23 04:55:01 UTC (rev 1560) @@ -72,36 +72,36 @@ { printf("Usage: batctl [options] originators \n"); printf("options:\n"); - printf(" \t -b batch mode - read the originator table once and quit\n"); printf(" \t -h print this help\n"); printf(" \t -n don't replace mac addresses with bat-host names\n"); + printf(" \t -w watch mode - refresh the originator table continuously\n"); }
void trans_local_usage(void) { printf("Usage: batctl [options] translocal \n"); printf("options:\n"); - printf(" \t -b batch mode - read the local translation table once and quit\n"); printf(" \t -h print this help\n"); printf(" \t -n don't replace mac addresses with bat-host names\n"); + printf(" \t -w watch mode - refresh the local translation table continuously\n"); }
void trans_global_usage(void) { printf("Usage: batctl [options] transglobal \n"); printf("options:\n"); - printf(" \t -b batch mode - read the global translation table once and quit\n"); printf(" \t -h print this help\n"); printf(" \t -n don't replace mac addresses with bat-host names\n"); + printf(" \t -w watch mode - refresh the global translation table continuously\n"); }
void gw_srv_list_usage(void) { printf("Usage: batctl [options] gw_srv_list \n"); printf("options:\n"); - printf(" \t -b batch mode - read the gateway server list once and quit\n"); printf(" \t -h print this help\n"); printf(" \t -n don't replace mac addresses with bat-host names\n"); + printf(" \t -w watch mode - refresh the gateway server list continuously\n"); }
void orig_interval_usage(void) @@ -134,19 +134,19 @@
int handle_table(int argc, char **argv, char *file_path, void table_usage(void)) { - int optchar, read_opt = CLR_CONT_READ | USE_BAT_HOSTS; + int optchar, read_opt = USE_BAT_HOSTS;
- while ((optchar = getopt(argc, argv, "bhn")) != -1) { + while ((optchar = getopt(argc, argv, "hnw")) != -1) { switch (optchar) { - case 'b': - read_opt &= ~CLR_CONT_READ; - break; case 'h': table_usage(); return EXIT_SUCCESS; case 'n': read_opt &= ~USE_BAT_HOSTS; break; + case 'w': + read_opt |= CLR_CONT_READ; + break; default: table_usage(); return EXIT_FAILURE;
Modified: trunk/batctl/sys.c =================================================================== --- trunk/batctl/sys.c 2010-01-20 18:25:36 UTC (rev 1559) +++ trunk/batctl/sys.c 2010-01-23 04:55:01 UTC (rev 1560) @@ -36,22 +36,18 @@ printf("Usage: batctl [options] log [logfile]\n"); printf("Note: if no logfile was specified stdin is read"); printf("options:\n"); - printf(" \t -b batch mode - read the log file once and quit\n"); printf(" \t -h print this help\n"); printf(" \t -n don't replace mac addresses with bat-host names\n"); + printf(" \t -w watch mode - read the log file continuously\n"); }
int log_print(int argc, char **argv) { - int optchar, read_opt = CONT_READ | USE_BAT_HOSTS | LOG_MODE; + int optchar, read_opt = USE_BAT_HOSTS | LOG_MODE; int found_args = 1;
- while ((optchar = getopt(argc, argv, "bhn")) != -1) { + while ((optchar = getopt(argc, argv, "hnw")) != -1) { switch (optchar) { - case 'b': - read_opt &= ~CONT_READ; - found_args += 1; - break; case 'h': log_usage(); return EXIT_SUCCESS; @@ -59,6 +55,10 @@ read_opt &= ~USE_BAT_HOSTS; found_args += 1; break; + case 'w': + read_opt |= CONT_READ; + found_args += 1; + break; default: log_usage(); return EXIT_FAILURE;