Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

About the new long/short options changes



Just now had a chance to compile this up and try it.

I mostly like the way it looks in listings, though I wish it would line up
the single-letter options in a column (or else always list the short form
first when there is one, though that might look odd when some of the long
forms have no short form).

However, I strongly *dis*like the way it works in menu-selection.  So much
so that I'd rather just turn it off entirely if it can't be made to work
better.  In particular I don't want selection to consume twice as many
lines (half of which are largely blank) as listing consumes.  I find it
better to have listing consume more lines in the first place than to have
the display change so radically when switching from listing to selection.

Sven wrote:
} Adding a style so that menu selection allows to select only one of the
} options would be a lot easier to write.  Making it display only one of
} the options per line (instead of a duplicated `-H, --help') is something
} I thought about, too, but that would require that we are able to tell in
} _describe if we are going to enter menu selection.  And that isn't
} always possible because it might depend on the number of matches
} generated.  If people would be satisfied with an approximation, i.e.
} simplifying the strings if it thinks it will enter menu selection, but
} probably sometimes entering menu selection with duplicated `-H, --help',
} I could probably implement that without much work.

I would not be happy with an approximation (if that's what gets done, so
be it, I'll just turn it all off).  Offering only one of the choices when
menu-selecting would be much better than what's happening now.  Best would
be if both could be selected right where they first appear, from the same
single line with the explanation string (which is, in part, why I ask for
the short forms to appear in a column).

} And about using `"' instead of the `|': [...]
} 
}   % foo -<TAB>
}   -H  --help    -- print help
}       "         --     "

This would, IMO, serve no purpose other than to emphasize the amount of
screen real estate that we're wasting on useless white space.

} Anyone else want to draw some pictures? ;-)

What I'd like to see, I think, is something like the following (where `['
and `]' delimit the menu-selection highlight).  For purposes of drawing
a more interesting picure, suppose that the -X option doesn't exist.

  Completing option
 [--binary                ] -b -- Unix line endings LF
  --change-cygdrive-prefix  -c -- cygdrive prefix
  --cygwin-executable          -- all files under mountpoint are cygwin e
  --executable              -x -- all files under mountpoint are executab
  --force                   -f -- be silent
  --import-old-mounts       -i -- import old mounts
  --show-cygdrive-prefix    -p -- show cygdrive prefix
  --system                  -s -- system-wide mount point
  --text                    -t -- (default) DOS line endings CR-LF
  --user                    -u -- (default)user private mount point

TAB to the next selection (list now truncated for brevity):

  Completing option
  --binary                 [-b -- Unix line endings LF                   ]
  --change-cygdrive-prefix  -c -- cygdrive prefix
  --cygwin-executable          -- all files under mountpoint are cygwin e
  --executable              -x -- all files under mountpoint are executab
  --force                   -f -- be silent

After three more TABs:

  Completing option
  --binary                  -b -- Unix line endings LF
  --change-cygdrive-prefix  -c -- cygdrive prefix
 [--cygwin-executable          -- all files under mountpoint are cygwin e]
  --executable              -x -- all files under mountpoint are executab
  --force                   -f -- be silent

See where this is going?

I recognize that this is probably quite difficult to pull off, especially
in cases where there might be more than two options that have the same
description.  So I'd settle for only being able to select one of the
choices on each line (provided that ordinary menu completion can at least
optionally still cycle through all possibilities).

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   



Messages sorted by: Reverse Date, Date, Thread, Author