aboutsummaryrefslogtreecommitdiffstats
path: root/Tools/scripts/dialogwrapper.txt
blob: 99d8b8d0ac18a06c5b80c28ce77cfc4d9f107540 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
$FreeBSD$

Updated August 6, 2012

Bug fix for use on FreeBSD 8.x supplied by Devin Teske.  Thanks!


What is this?

This is a sh/awk wrapper script to give the ports options setting screen
more features:

  Extended descriptions for FreeBSD 8.3+ and 9.0+.  Port maintainers can
  make descriptions longer and more explanatory.

  Auto-sizing of the option screen to fit the terminal window.  Wider or
  taller windows can display more of the descriptions, or more options.
  Windows smaller than 80x24 also work.

  Older versions of dialog(1) had a bug in displaying descriptions that
  are longer than the available space.  When an old version of dialog is
  detected, descriptions are cut to the available space.  These earlier
  versions of dialog did not support the --item-help feature used to
  show extended descriptions, so only the trimmed description will be
  shown.  Descriptions that have been trimmed will still end in a "+" to
  indicate that part of it has been trimmed.



Installation

Edit /etc/make.conf:

  DIALOG="/usr/ports/Tools/scripts/dialogwrapper.sh"


Testing long descriptions

Open a terminal window and resize it, making it narrower than the
default 80 columns.  Try 60 or 70 columns.

su to root and run 'make config' for a port that uses long descriptions.
For example:

  # cd /usr/ports/audio/xmms2
  # make config

Descriptions that are too long to fit in the window are shown ending in
a "+".  Scroll downward through the settings to see that the missing
part of the description is shown at the bottom of the screen.



Testing auto-sizing

Open a terminal window and resize it, making it taller than the default
24 lines.  print/ghostscript9 is a good example.

  # cd /usr/ports/print/ghostscript9
  # make config

Work remaining to be done

Cleanup of the code and additional comments.

Testing.

The trimming algorithm should break the description on whitespace to
improve readability.  fold(1) may be an easy way to do that.