$MidnightBSD$

Updated August 6, 2012

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.
