Alle Fenster ueber drei gemeinsame Stellen, Selbstpruefung dazu
Die berechnete Fenstergroesse galt bisher nur fuer die Dialoge, die ich
dafuer einzeln angefasst hatte. Eine Pruefung des ganzen Projekts zeigte
zwei Luecken:
* in common.sh gab es neun verstreute Aufrufstellen von dialog/whiptail
* migrate_creator.sh hatte noch durchgehend feste Groessen
(20 76 11, 10 76, 18 76, 14 76, 22 78, 8 76)
Beide Skripte rufen dialog/whiptail jetzt nur noch ueber drei Stellen auf:
_ui_list Listenfenster (menu, checklist, radiolist)
_ui_box Textfenster (msgbox, yesno, inputbox, passwordbox, infobox)
_ui_file Dateianzeige (textbox)
Die berechnen die Groesse selbst. Damit stimmt sie auch fuer Fenster, die
spaeter dazukommen - man muss nur eine der ui_*-Huellen benutzen.
Neu: "cmk-manage.sh selftest" haelt das nach. Geprueft werden Syntax
aller vier Skripte, Dialoge an den Engstellen vorbei, fest eingetragene
Fenstergroessen, das Muster "[ ... ] && VAR=..." und die Vollstaendigkeit
der Einstellungstabelle gegenueber .env.example.
Der Lauf fand sofort 19 Altlasten des Musters "[ ... ] && VAR=...", das
hier schon dreimal einen stillen Abbruch verursacht hat - alle in
if-Bloecke umgeschrieben und stichprobenartig geprueft, auch die Faelle
mit case-Abschluss und Array-Zuweisung. Danach laeuft die Selbstpruefung
vollstaendig durch.
Regression: alle CLI-Kommandos, zwoelf Menuefunktionen und das Rendern
von sechs Fenstern unter whiptail in einem echten Pseudo-Terminal.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1625,6 +1625,28 @@ Operation: arrow keys, **space** toggles entries in selection lists (e.g.
|
||||
several sites for a backup), **Enter** confirms, **ESC/Cancel** goes back.
|
||||
The window size adapts to the terminal size, the length of the text and the
|
||||
number of entries – in a larger terminal more entries are visible at once.
|
||||
This holds for **every** window, `migrate_creator.sh` included: all dialogs go
|
||||
through three shared entry points in
|
||||
[scripts/lib/common.sh](scripts/lib/common.sh) which compute the size
|
||||
themselves.
|
||||
|
||||
### 14.4 Self-check
|
||||
|
||||
```bash
|
||||
./scripts/cmk-manage.sh selftest
|
||||
```
|
||||
|
||||
Checks the scripts for the pitfalls that turned out to be recurring here:
|
||||
|
||||
| Check | Why |
|
||||
|---|---|
|
||||
| syntax of all four scripts | typos surface immediately |
|
||||
| dialogs go through the shared entry points | otherwise a new window would get a fixed size again |
|
||||
| no hard-coded window sizes | same reason |
|
||||
| no `[ … ] && VAR=…` | returns 1 when the condition is false and aborts the script under `set -e` – the cause of a silent abort three times |
|
||||
| settings table complete | every key has six fields and appears in `.env.example` |
|
||||
|
||||
Worth running after adding your own menu entries.
|
||||
`dialog` is preferred; if only `whiptail` is present, that is used instead.
|
||||
A file chooser with directory navigation is built in.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user