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

Trying to improve completion for pgmkernel



I'm trying to improve the completion for the program pgmkernel, part of netpbm, currently completed by the
Completion/Unix/Command/_pbm file.

Currently, the completion is:

  _arguments '-weight:weight' ':width' ':height'

The usage for the program is:

usage:  pgmkernel [-weight f] width [height]

A fix I know how to make (and tested it, and it works) is to stop the -weight option from being completed after width or height is entered. However, there are still problems. Specifically, when you type:

pgmkernel -

it tries to complete both the option (as it should) *and* width (as it shouldn't) -- presumably because it doesn't know that width has to be a positive integer. How can I tell it this? I looked for a regex type of ACTION, but all I could find was the {EVAL-STRING} form and that didn't seem like a good idea. I'm sure there's got to be a way to say -- "this arguments accepts any positive integer", but I haven't found it. Any suggestions?

Jesse Weinstein



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