int main(int argc, char *argv[]) { int c; bool monochrome = FALSE; InitPanel myInit = init_panel; FillPanel myFill = fill_panel; while ((c = getopt(argc, argv, "mw")) != EOF) { switch (c) { case 'm': monochrome = TRUE; break; #if USE_WIDEC_SUPPORT case 'w': myInit = init_wide_panel; myFill = fill_wide_panel; break; #endif default: usage(); } } initscr(); use_colors = monochrome ? FALSE : has_colors(); if (use_colors) start_color(); demo_panels(myInit, myFill); endwin(); return EXIT_SUCCESS; }
int main(int argc, char *argv[]) { int c; bool monochrome = FALSE; InitPanel myInit = init_panel; FillPanel myFill = fill_panel; setlocale(LC_ALL, ""); while ((c = getopt(argc, argv, "i:o:mwx")) != -1) { switch (c) { case 'i': log_in = fopen(optarg, "r"); break; case 'o': log_out = fopen(optarg, "w"); break; case 'm': monochrome = TRUE; break; #if USE_WIDEC_SUPPORT case 'w': myInit = init_wide_panel; myFill = fill_wide_panel; break; #endif case 'x': unboxed = TRUE; break; default: usage(); } } if (unboxed) myFill = fill_unboxed; initscr(); cbreak(); noecho(); keypad(stdscr, TRUE); use_colors = monochrome ? FALSE : has_colors(); if (use_colors) start_color(); demo_panels(myInit, myFill); endwin(); close_input(); close_output(); ExitProgram(EXIT_SUCCESS); }