Lines Matching +full:button +full:-

1 /*-
2 * SPDX-License-Identifier: BSD-2-Clause
4 * Copyright (c) 2021-2023 Alfonso Sabato Siciliano
152 {"alternate-screen", no_argument, NULL, ALTERNATE_SCREEN},
153 {"and-dialog", no_argument, NULL, AND_DIALOG},
154 {"and-widget", no_argument, NULL, AND_DIALOG},
155 {"ascii-lines", no_argument, NULL, ASCII_LINES},
157 {"begin-x", required_argument, NULL, BEGIN_X},
158 {"begin-y", required_argument, NULL, BEGIN_Y},
160 {"cancel-exit-code", required_argument, NULL, CANCEL_EXIT_CODE},
161 {"cancel-label", required_argument, NULL, CANCEL_LABEL},
163 {"clear-dialog", no_argument, NULL, CLEAR_DIALOG},
164 {"clear-screen", no_argument, NULL, CLEAR_SCREEN},
166 {"columns-per-row", required_argument, NULL, COLUMNS_PER_ROW},
167 {"cr-wrap", no_argument, NULL, CR_WRAP},
168 {"datebox-format", required_argument, NULL, DATEBOX_FORMAT},
169 {"date-format", required_argument, NULL, DATE_FORMAT},
171 {"default-button", required_argument, NULL, DEFAULT_BUTTON},
172 {"default-item", required_argument, NULL, DEFAULT_ITEM},
173 {"default-no", no_argument, NULL, DEFAULT_NO},
174 {"disable-esc", no_argument, NULL, DISABLE_ESC},
175 {"error-exit-code", required_argument, NULL, ERROR_EXIT_CODE},
176 {"esc-exit-code", required_argument, NULL, ESC_EXIT_CODE},
177 {"exit-label", required_argument, NULL, EXIT_LABEL},
178 {"extra-button", no_argument, NULL, EXTRA_BUTTON},
179 {"extra-exit-code", required_argument, NULL, EXTRA_EXIT_CODE},
180 {"extra-label", required_argument, NULL, EXTRA_LABEL},
181 {"help-button", no_argument, NULL, HELP_BUTTON},
182 {"help-exit-code", required_argument, NULL, HELP_EXIT_CODE},
183 {"help-label", required_argument, NULL, HELP_LABEL},
184 {"help-print-items", no_argument, NULL, HELP_PRINT_ITEMS},
185 {"help-print-name", no_argument, NULL, HELP_PRINT_NAME},
186 {"help-status", no_argument, NULL, HELP_PRINT_ITEMS},
187 {"help-tags", no_argument, NULL, HELP_PRINT_NAME},
193 {"item-bottom-desc", no_argument, NULL, ITEM_BOTTOM_DESC},
194 {"item-depth", no_argument, NULL, ITEM_DEPTH},
195 {"item-help", no_argument, NULL, ITEM_BOTTOM_DESC},
196 {"item-prefix", no_argument, NULL, ITEM_PREFIX},
197 {"keep-tite", no_argument, NULL, ALTERNATE_SCREEN},
198 {"left1-button", required_argument, NULL, LEFT1_BUTTON},
199 {"left1-exit-code", required_argument, NULL, LEFT1_EXIT_CODE},
200 {"left2-button", required_argument, NULL, LEFT2_BUTTON},
201 {"left2-exit-code", required_argument, NULL, LEFT2_EXIT_CODE},
202 {"left3-button", required_argument, NULL, LEFT3_BUTTON},
203 {"left3-exit-code", required_argument, NULL, LEFT3_EXIT_CODE},
204 {"load-theme", required_argument, NULL, LOAD_THEME},
205 {"max-input", required_argument, NULL, MAX_INPUT_FORM},
206 {"no-cancel", no_argument, NULL, NO_CANCEL},
208 {"no-descriptions", no_argument, NULL, NO_DESCRIPTIONS},
209 {"no-items", no_argument, NULL, NO_DESCRIPTIONS},
210 {"no-label", required_argument, NULL, CANCEL_LABEL},
211 {"no-lines", no_argument, NULL, NO_LINES},
212 {"no-names", no_argument, NULL, NO_NAMES},
213 {"no-ok", no_argument, NULL, NO_OK},
215 {"no-shadow", no_argument, NULL, NO_SHADOW},
216 {"no-tags", no_argument, NULL, NO_NAMES},
217 {"normal-screen", no_argument, NULL, NORMAL_SCREEN},
218 {"ok-exit-code", required_argument, NULL, OK_EXIT_CODE},
219 {"ok-label", required_argument, NULL, OK_LABEL},
220 {"output-fd", required_argument, NULL, OUTPUT_FD},
221 {"output-separator", required_argument, NULL, OUTPUT_SEPARATOR},
222 {"print-maxsize", no_argument, NULL, PRINT_MAXSIZE},
223 {"print-size", no_argument, NULL, PRINT_SIZE},
224 {"print-version", no_argument, NULL, PRINT_VERSION},
226 {"right1-button", required_argument, NULL, RIGHT1_BUTTON},
227 {"right1-exit-code", required_argument, NULL, RIGHT1_EXIT_CODE},
228 {"right2-button", required_argument, NULL, RIGHT2_BUTTON},
229 {"right2-exit-code", required_argument, NULL, RIGHT2_EXIT_CODE},
230 {"right3-button", required_argument, NULL, RIGHT3_BUTTON},
231 {"right3-exit-code", required_argument, NULL, RIGHT3_EXIT_CODE},
232 {"save-theme", required_argument, NULL, SAVE_THEME},
233 {"separate-output", no_argument, NULL, SEPARATE_OUTPUT},
236 {"single-quoted", no_argument, NULL, SINGLE_QUOTED},
240 {"switch-buttons", no_argument, NULL, SWITCH_BUTTONS},
241 {"tab-escape", no_argument, NULL, TAB_ESCAPE},
242 {"tab-len", required_argument, NULL, TAB_LEN},
243 {"text-escape", no_argument, NULL, TEXT_ESCAPE},
244 {"text-unchanged", no_argument, NULL, TEXT_UNCHANGED},
246 {"timeout-exit-code", required_argument, NULL, TIMEOUT_EXIT_CODE},
247 {"time-format", required_argument, NULL, TIME_FORMAT},
249 {"yes-label", required_argument, NULL, OK_LABEL},
277 printf("usage: bsddialog --help | --version\n");
278 printf(" bsddialog [--<opt>] --<dialog> <text> <rows> <cols> "
279 "[<arg>] [--<opt>]\n");
280 printf(" bsddialog ... --<dialog1> ... [--and-dialog --<dialog2> "
285 printf(" --alternate-screen, --ascii-lines, --backtitle <backtitle>,"
286 " --begin-x <x>,\n --begin-y <y>, --bikeshed,"
287 " --cancel-exit-code <retval>, --cancel-label <label>,\n"
288 " --clear-dialog, --clear-screen, --columns-per-row <columns>,"
289 " --cr-wrap,\n --datebox-format d/m/y|m/d/y|y/m/d,"
290 " --date-format <format>,\n --default-button <label>,"
291 " --default-item <name>, --default-no, --disable-esc,\n"
292 " --error-exit-code <retval>, --esc-exit-code <retval>,"
293 " --exit-label <label>,\n --extra-button,"
294 " --extra-exit-code <retval>, --extra-label <label>,\n"
295 " --left1-button <label>, --left1-exit-code <retval>,"
296 " --left2-button <label>,\n --left2-exit-code <retval>,"
297 " --left3-button <label>, --left3-exit-code <retval>,\n"
298 " --help-button, --help-exit-code <retval>, --help-label <label>,\n"
299 " --help-print-items, --help-print-name, --hfile <file>,"
300 " --hline <string>,\n --hmsg <string>, --ignore, --insecure,"
301 " --item-bottom-desc, --item-depth,\n --item-prefix,"
302 " --load-theme <file>, --max-input <size>, --no-cancel,\n"
303 " --no-descriptions, --no-label <label>, --no-lines, --no-names,"
304 " --no-ok,\n --no-shadow, --normal-screen, --ok-exit-code <retval>,"
305 " --ok-label <label>,\n --output-fd <fd>, --output-separator <sep>,"
306 " --print-maxsize, --print-size,\n --print-version, --quoted,"
307 " --right1-button <label>,\n --right1-exit-code <retval>,"
308 " --right2-button <label>,\n --right2-exit-code <retval>,"
309 " --right3-button <label>,\n --right3-exit-code <retval>,"
310 " --save-theme <file>, --separate-output,\n --separator <sep>,"
311 " --shadow, --single-quoted, --sleep <secs>, --stderr,\n --stdout,"
312 " --switch-buttons, --tab-escape, --tab-len <spaces>,"
313 " --text-escape,\n --text-unchanged, --theme 3d|blackwhite|flat,"
314 " --timeout-exit-code <retval>,\n --time-format <format>,"
315 " --title <title>, --yes-label <label>.");
319 printf(" --calendar <text> <rows> <cols> [<dd> <mm> <yy>]\n");
320 printf(" --checklist <text> <rows> <cols> <menurows> [<name> <desc> "
322 printf(" --datebox <text> <rows> <cols> [<dd> <mm> <yy>]\n");
323 printf(" --form <text> <rows> <cols> <formrows> [<label> <ylabel> "
326 printf(" --gauge <text> <rows> <cols> [<perc>]\n");
327 printf(" --infobox <text> <rows> <cols>\n");
328 printf(" --inputbox <text> <rows> <cols> [<init>]\n");
329 printf(" --menu <text> <rows> <cols> <menurows> [<name> <desc>] ...\n");
330 printf(" --mixedform <text> <rows> <cols> <formrows> [<label> <ylabel> "
333 printf(" --mixedgauge <text> <rows> <cols> <mainperc> [<minilabel> "
335 printf(" --msgbox <text> <rows> <cols>\n");
336 printf(" --passwordbox <text> <rows> <cols> [<init>]\n");
337 printf(" --passwordform <text> <rows> <cols> <formrows> [<label> "
340 printf(" --pause <text> <rows> <cols> <secs>\n");
341 printf(" --radiolist <text> <rows> <cols> <menurows> [<name> <desc> "
343 printf(" --rangebox <text> <rows> <cols> <min> <max> [<init>]\n");
344 printf(" --textbox <file> <rows> <cols>\n");
345 printf(" --timebox <text> <rows> <cols> [<hh> <mm> <ss>]\n");
346 printf(" --treeview <text> <rows> <cols> <menurows> [<depth> <name> "
348 printf(" --yesno <text> <rows> <cols>\n");
362 conf->key.enable_esc = true;
363 conf->button.always_active = true;
366 opt->theme = -1;
367 opt->output_fd = STDERR_FILENO;
368 opt->max_input_form = 2048;
369 opt->mandatory_dialog = true;
372 if (strcmp(argv[i], "--and-dialog") == 0 ||
373 strcmp(argv[i], "--and-widget") == 0) {
379 while ((arg = getopt_long(argc, argv, "", longopts, NULL)) != -1) {
383 opt->screen_mode = "smcup";
386 if (opt->dialogbuilder == NULL)
387 exit_error(true,"--and-dialog without "
388 "previous --<dialog>");
391 conf->ascii_lines = true;
394 opt->backtitle = optarg;
395 if (conf->y == BSDDIALOG_CENTER)
396 conf->auto_topmargin = 2;
399 conf->x = (int)strtol(optarg, NULL, 10);
400 if (conf->x < BSDDIALOG_CENTER)
401 exit_error(false, "--begin-x %d is < %d",
402 conf->x, BSDDIALOG_CENTER);
405 conf->y = (int)strtol(optarg, NULL, 10);
406 if (conf->y < BSDDIALOG_CENTER)
407 exit_error(false, "--begin-y %d is < %d",
408 conf->y, BSDDIALOG_CENTER);
409 conf->auto_topmargin = 0;
412 opt->bikeshed = true;
419 conf->button.cancel_label = optarg;
422 conf->clear = true;
425 opt->mandatory_dialog = false;
426 opt->clearscreen = true;
429 conf->text.cols_per_row =
433 opt->cr_wrap = true;
437 conf->date.format = "d/m/y";
439 conf->date.format = "m/d/y";
441 conf->date.format = "y/m/d";
447 opt->date_fmt = optarg;
450 conf->button.default_label = optarg;
453 opt->item_default = optarg;
456 conf->button.default_cancel = true;
459 conf->key.enable_esc = false;
470 conf->button.ok_label = optarg;
473 conf->button.with_extra = true;
480 conf->button.extra_label = optarg;
483 conf->button.with_help = true;
492 conf->button.help_label = optarg;
495 opt->help_print_items = true;
498 opt->help_print_item_name = true;
501 conf->key.f1_file = optarg;
505 conf->bottomtitle = optarg;
508 conf->key.f1_message = optarg;
511 opt->ignore = true;
514 conf->form.securech = '*';
517 opt->item_bottomdesc = true;
520 opt->item_depth = true;
523 opt->item_prefix = true;
526 conf->button.left1_label = optarg;
533 conf->button.left2_label = optarg;
540 conf->button.left3_label = optarg;
547 opt->loadthemefile = optarg;
550 opt->max_input_form = (u_int)strtoul(optarg, NULL, 10);
553 conf->button.without_cancel = true;
556 conf->menu.no_desc = true;
559 conf->no_lines = true;
562 conf->menu.no_name = true;
565 conf->button.without_ok = true;
568 conf->shadow = false;
571 opt->screen_mode = "rmcup";
578 conf->button.ok_label = optarg;
581 opt->output_fd = (int)strtol(optarg, NULL, 10);
584 opt->item_output_sep = optarg;
587 opt->item_always_quote = true;
590 opt->mandatory_dialog = false;
592 dprintf(opt->output_fd, "MaxSize: %d, %d\n",
596 conf->get_height = &opt->getH;
597 conf->get_width = &opt->getW;
600 opt->mandatory_dialog = false;
601 dprintf(opt->output_fd, "Version: %s\n",
605 conf->button.right1_label = optarg;
612 conf->button.right2_label = optarg;
619 conf->button.right3_label = optarg;
626 opt->mandatory_dialog = false;
627 opt->savethemefile = optarg;
630 opt->item_output_sepnl = true;
633 conf->shadow = true;
636 opt->item_singlequote = true;
639 conf->sleep = (u_int)strtoul(optarg, NULL, 10);
642 opt->output_fd = STDERR_FILENO;
645 opt->output_fd = STDOUT_FILENO;
648 conf->button.always_active = false;
651 opt->tab_escape = true;
654 conf->text.tablen = (u_int)strtoul(optarg, NULL, 10);
657 conf->text.escape = true;
660 opt->text_unchanged = true;
664 opt->theme = BSDDIALOG_THEME_BLACKWHITE;
666 opt->theme = BSDDIALOG_THEME_FLAT;
668 opt->theme = BSDDIALOG_THEME_3D;
671 "--theme: \"%s\" is unknown", optarg);
678 opt->time_fmt = optarg;
681 conf->title = optarg;
685 if (opt->dialogbuilder != NULL)
686 exit_error(true, "%s and --calendar without "
687 "--and-dialog", opt->name);
688 opt->name = "--calendar";
689 opt->dialogbuilder = calendar_builder;
692 if (opt->dialogbuilder != NULL)
693 exit_error(true, "%s and --checklist without "
694 "--and-dialog", opt->name);
695 opt->name = "--checklist";
696 opt->dialogbuilder = checklist_builder;
697 conf->auto_downmargin = 1;
700 if (opt->dialogbuilder != NULL)
701 exit_error(true, "%s and --datebox without "
702 "--and-dialog", opt->name);
703 opt->name = "--datebox";
704 opt->dialogbuilder = datebox_builder;
707 if (opt->dialogbuilder != NULL)
708 exit_error(true, "%s and --form without "
709 "--and-dialog", opt->name);
710 opt->name = "--form";
711 opt->dialogbuilder = form_builder;
712 conf->auto_downmargin = 1;
715 if (opt->dialogbuilder != NULL)
716 exit_error(true, "%s and --gauge without "
717 "--and-dialog", opt->name);
718 opt->name = "--gauge";
719 opt->dialogbuilder = gauge_builder;
722 if (opt->dialogbuilder != NULL)
723 exit_error(true, "%s and --infobox without "
724 "--and-dialog", opt->name);
725 opt->name = "--infobox";
726 opt->dialogbuilder = infobox_builder;
729 if (opt->dialogbuilder != NULL)
730 exit_error(true, "%s and --inputbox without "
731 "--and-dialog", opt->name);
732 opt->name = "--inputbox";
733 opt->dialogbuilder = inputbox_builder;
734 conf->auto_downmargin = 1;
737 if (opt->dialogbuilder != NULL)
738 exit_error(true, "%s and --menu without "
739 "--and-dialog", opt->name);
740 opt->name = "--menu";
741 opt->dialogbuilder = menu_builder;
742 conf->auto_downmargin = 1;
745 if (opt->dialogbuilder != NULL)
746 exit_error(true, "%s and --mixedform without "
747 "--and-dialog", opt->name);
748 opt->name = "--mixedform";
749 opt->dialogbuilder = mixedform_builder;
750 conf->auto_downmargin = 1;
753 if (opt->dialogbuilder != NULL)
754 exit_error(true, "%s and --mixedgauge without "
755 "--and-dialog", opt->name);
756 opt->name = "--mixedgauge";
757 opt->dialogbuilder = mixedgauge_builder;
760 if (opt->dialogbuilder != NULL)
761 exit_error(true, "%s and --msgbox without "
762 "--and-dialog", opt->name);
763 opt->name = "--";
764 opt->dialogbuilder = msgbox_builder;
767 if (opt->dialogbuilder != NULL)
768 exit_error(true, "%s and --pause without "
769 "--and-dialog", opt->name);
770 opt->name = "--pause";
771 opt->dialogbuilder = pause_builder;
774 if (opt->dialogbuilder != NULL)
775 exit_error(true, "%s and --passwordbox without "
776 "--and-dialog", opt->name);
777 opt->name = "--passwordbox";
778 opt->dialogbuilder = passwordbox_builder;
779 conf->auto_downmargin = 1;
782 if (opt->dialogbuilder != NULL)
783 exit_error(true, "%s and --passwordform "
784 "without --and-dialog", opt->name);
785 opt->name = "--passwordform";
786 opt->dialogbuilder = passwordform_builder;
787 conf->auto_downmargin = 1;
790 if (opt->dialogbuilder != NULL)
791 exit_error(true, "%s and --radiolist without "
792 "--and-dialog", opt->name);
793 opt->name = "--radiolist";
794 opt->dialogbuilder = radiolist_builder;
795 conf->auto_downmargin = 1;
798 if (opt->dialogbuilder != NULL)
799 exit_error(true, "%s and --rangebox without "
800 "--and-dialog", opt->name);
801 opt->name = "--rangebox";
802 opt->dialogbuilder = rangebox_builder;
805 if (opt->dialogbuilder != NULL)
806 exit_error(true, "%s and --textbox without "
807 "--and-dialog", opt->name);
808 opt->name = "--textbox";
809 opt->dialogbuilder = textbox_builder;
812 if (opt->dialogbuilder != NULL)
813 exit_error(true, "%s and --timebox without "
814 "--and-dialog", opt->name);
815 opt->name = "--timebox";
816 opt->dialogbuilder = timebox_builder;
819 if (opt->dialogbuilder != NULL)
820 exit_error(true, "%s and --treeview without "
821 "--and-dialog", opt->name);
822 opt->name = "--treeview";
823 opt->dialogbuilder = treeview_builder;
824 conf->auto_downmargin = 1;
827 if (opt->dialogbuilder != NULL)
828 exit_error(true, "%s and --yesno without "
829 "--and-dialog", opt->name);
830 opt->name = "--yesno";
831 opt->dialogbuilder = yesno_builder;
834 if (opt->ignore == true)
836 exit_error(true, "--ignore to continue");