From 837a73366da84f2ab85a5a9a1802db7151dea47f Mon Sep 17 00:00:00 2001 From: wkh Date: Sun, 11 Oct 2026 21:54:38 +0200 Subject: [PATCH] =?UTF-8?q?demo:=20Eingabemaske=20entry=20f=C3=BCr=20scree?= =?UTF-8?q?n?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 3 +++ README.md | 9 +++++++++ demo/entry | 6 ++++++ demo/testall.cmds | 7 +++++-- demo/testall.old | 39 +++++++++++++++++++++++++++++++++------ 5 files changed, 56 insertions(+), 8 deletions(-) create mode 100644 demo/entry diff --git a/CHANGELOG.md b/CHANGELOG.md index af6fd51..476457a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,9 @@ folgen [Semantic Versioning](https://semver.org/lang/de/). Die Version steht in ## [Unveröffentlicht] +### Hinzugefügt +- `demo/entry`: beschriftete Eingabemaske für `screen` (README erklärt den Unterschied zu `form`). + ## [0.3.0] - 2026-10-11 ### Hinzugefügt diff --git a/README.md b/README.md index 82fa721..608b1c7 100644 --- a/README.md +++ b/README.md @@ -77,6 +77,15 @@ Eine Zeile mit `##` erscheint als Überschrift in der Ausgabe, eine mit `#` ist ein stiller Kommentar. Neue Befehle brauchen hier ein Beispiel, sonst schlägt der Test `test_testall_mentions_every_command` fehl. +## Vorlagen: `form` und `entry` + +- `demo/form` ist eine Vorlage für `report` und `letter`: sie setzt Spaltenwerte in einen Text ein. + Sie hat keine Beschriftungen und nennt `Name` zweimal. +- `demo/entry` ist eine Eingabemaske für `screen`: jedes Feld kommt einmal vor und hat eine + Beschriftung. `screen < entry > maske.sh` erzeugt das Skript. Starten: + `CLEAR=$(clear.rdb) sh maske.sh > tabelle 2>&1`. Die Tabelle geht auf stderr (wie im Original), + daher das `2>&1`. Mit `form` würde die Maske leer und doppelt aussehen. + ## Befehle | Gruppe | Befehle | diff --git a/demo/entry b/demo/entry new file mode 100644 index 0000000..d489ff0 --- /dev/null +++ b/demo/entry @@ -0,0 +1,6 @@ + Mail List Entry Form + +Name : Company: +Street: +City : State : ZIP: +Phone : diff --git a/demo/testall.cmds b/demo/testall.cmds index d7e7669..9c2c381 100644 --- a/demo/testall.cmds +++ b/demo/testall.cmds @@ -182,8 +182,11 @@ report form < maillist ## label prints mailing labels, letter prints form letters label < maillist letter form < maillist | head -5 -## screen turns a form into a shell script that asks for the fields -screen < form | head -6 +## screen turns a form into a shell script that asks for the fields. Use a form with labels +## and every column once (entry); the report template `form` would give a blank, doubled screen. +## Run the script with: CLEAR=$(clear.rdb) sh script > table 2>&1 (the table goes to stderr) +cat entry +screen < entry ## reportwriter: a sample report with page headings (the date is cut out) reportwriter -3 Prices < inventory | grep -v 'Report Date' ## tabletom4 / tabletosed / tabletostruct were shown above diff --git a/demo/testall.old b/demo/testall.old index 8599f9a..1c3194c 100644 --- a/demo/testall.old +++ b/demo/testall.old @@ -735,14 +735,41 @@ McDonalds 123 Mac Attack Memphis, TENN 30000 -## screen turns a form into a shell script that asks for the fields -$ screen < form | head -6 +## screen turns a form into a shell script that asks for the fields. Use a form with labels +## and every column once (entry); the report template `form` would give a blank, doubled screen. +## Run the script with: CLEAR=$(clear.rdb) sh script > table 2>&1 (the table goes to stderr) +$ cat entry + Mail List Entry Form + +Name : Company: +Street: +City : State : ZIP: +Phone : +$ screen < entry : paint crt screen exec 1>/dev/tty cat <&2 +echo "Name Company Street City State ZIP Phone" +echo "---- ------- ------ ---- ----- --- -----" +: append row +echo "$Name $Company $Street $City $State $ZIP $Phone" ## reportwriter: a sample report with page headings (the date is cut out) $ reportwriter -3 Prices < inventory | grep -v 'Report Date' Prices @@ -777,7 +804,7 @@ Item Amount Cost Value Description ## tabletom4 / tabletosed / tabletostruct were shown above ## ===== Help and the terminal ===== $ rdb --version -rdb 0.2.0 +rdb 0.3.0 $ howmany 134 $ whatis row