xref: /freebsd/contrib/bsddialog/README.md (revision 963f5dc7a30624e95d72fb7f87b8892651164e46)
1# BSDDialog
2
3**Work In Progress!**
4
5This project provides **bsddialog** and **libbsddialog**, an utility and a
6library to build scripts and tools with *TUI Widgets*.
7
8Description:
9<https://www.freebsd.org/status/report-2021-04-2021-06/#_bsddialog_tui_widgets>
10
11Screenshots:
12<https://www.flickr.com/photos/alfonsosiciliano/albums/72157720215006074>
13
14
15## Getting Started
16
17FreeBSD:
18
19```
20% git clone https://gitlab.com/alfix/bsddialog.git
21% cd bsddialog
22% make
23% ./bsddialog --msgbox "Hello World!" 8 20
24```
25
26If you are using XFCE install
27[devel/ncurses](https://www.freshports.org/devel/ncurses/)
28
29```
30% sudo pkg install ncurses
31% git clone https://gitlab.com/alfix/bsddialog.git
32% cd bsddialog
33% make -DPORTNCURSES
34% ./bsddialog --msgbox "Hello World!" 8 20
35```
36
37Output:
38
39![screenshot](screenshot.png)
40
41
42Examples utility:
43```
44% ./bsddialog --title msgbox --msgbox "Hello World!" 5 30
45% ./bsddialog --theme default --title msgbox --msgbox "Hello World!" 5 30
46% ./bsddialog --begin-y 2 --title yesno --yesno "Hello World!" 5 30
47% ./bsddialog --ascii-lines --pause "Hello World!" 8 50 5
48% ./bsddialog --checklist "Space to select" 0 0 0 Name1 Desc1 off Name2 Desc2 on Name3 Desc3 off
49% ./bsddialog --backtitle "TITLE" --title yesno --hline "bsddialog" --yesno "Hello World!" 5 25
50% ./bsddialog --extra-button --help-button --defaultno --yesno "Hello World!" 0 0
51```
52and
53```
54% sh ./examples_utility/buildlist.sh
55% sh ./examples_utility/checklist.sh
56% sh ./examples_utility/form.sh
57% sh ./examples_utility/gauge.sh
58% sh ./examples_utility/infobox.sh
59% sh ./examples_utility/inputbox.sh
60% sh ./examples_utility/menu.sh
61% sh ./examples_utility/mixedform.sh
62% sh ./examples_utility/mixedgauge.sh
63% sh ./examples_utility/msgbox.sh
64% sh ./examples_utility/passwordbox.sh
65% sh ./examples_utility/passwordform.sh
66% sh ./examples_utility/radiolist.sh
67% sh ./examples_utility/treeview.sh
68% sh ./examples_utility/yesno.sh
69```
70
71Examples library:
72```
73% cd examples_library
74% sh compile
75% ./buildlist
76% ./compile
77% ./datebox
78% ./form
79% ./infobox
80% ./menu
81% ./mixedlist
82% ./msgbox
83% ./pause
84% ./radiolist
85% ./rangebox
86% ./sade
87% ./theme
88% ./timebox
89% ./treeview
90% ./yesno
91```
92
93Use Cases:
94
95 - [portconfig](https://gitlab.com/alfix/portconfig)
96
97
98## Features
99
100**Common Options:**
101
102--ascii-lines, --aspect *ratio* (for infobox, msgbox and yesno),
103--backtitle *backtitle*, --begin-x *x* (--begin *y y*),
104(--begin *y x*), --cancel-label *string*, -clear (test with multiple widgets),
105--colors, --date-format *format*, --default-button *string*, --defaultno,
106--default-item *string*,
107--exit-label *string*, --extra-button, --extra-label *string*,
108--hfile *filename* (for completed widgets), --help, --help-button,
109--help-label *string*, --help-status, --help-tags, --hline *string*, --ignore,
110--insecure, --item-help, --max-input *size*, --no-cancel, --nocancel,
111--no-label *string*, --no-items, --no-lines, --no-ok,
112--nook, --no-shadow, --no-tags, --ok-label *string*, --output-fd *fd*,
113--output-separator *string*, --print-version,
114--print-size (todo move lib -> utility), --quoted (quotes all != dialog),
115--print-maxsize, --shadow, --single-quoted (add --quote-with *ch*?),
116--separator *string* (alias --output-separator *string*),
117--separate-output (rename --separate-output-withnl?), --sleep *secs*, --stderr,
118--stdout, --theme *string* ("bsddialog", "dialog", "blackwhite"),
119--time-format *format*, --title *title*, --version, --yes-label *string*.
120
121**Widgets:**
122
123 infobox (do not clear the screen), msgbox,
124 yesno (dialog renames "yes/no" -> "ok/cancel" with --extra-button --help-button).
125 checklist, radiolist, menu, mixedlist, treeview, textbox, mixedgauge, datebox,
126 timebox, gauge, rangebox, pause.
127
128
129 Without resize:
130
131 form, inputbox, mixedform, passwordbox, passwordform.
132
133
134 Without autosize, resize, F1:
135
136 buildlist
137
138
139
140## TODO
141
142
143**Common Options:**
144
145|  Option                      | Status      | Note                            |
146| ---------------------------- | ----------- | ------------------------------- |
147| --cr-wrap                    | In progress | text                            |
148| --no-collapse                | In progress | text                            |
149| --no-nl-expand               | In progress | text                            |
150| --trim                       | In progress | text                            |
151
152
153To evaluate / Not planned in the short term / not in bsdinstall:
154
155--create-rc *file*, --iso-week, --no-mouse, --print-text-only *str h w*,
156--print-text-size *str h w*, --reorder, -scrollbar, --separate-widget *string*,
157--size-err, --timeout *secs*,--trace *filename*, --visit-items,
158--week-start *day*, --keep-tite, --keep-window, --last-key, --no-kill,
159--column-separator *string*, --input-fd *fd*, --tab-correct, --tab-len *n*
160
161
162**Widgets:**
163
164To evaluate / Not planned in the short term:
165
166tailbox (textbox/fseek), tailboxbg, dselect, fselect, inputmenu, editbox,
167calendar (use datebox), prgbox, programbox, progressbox.
168