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

Re: Another completion question



On Dec 28,  1:48am, Richard Hartmann wrote:
}
} most of you will be familiar with this construct:
} 
} -{h,-help}'[print help and exit]'

This is just a shorthand for

  -h'[print help and exit]'
  --help'[print help and exit]'

and is generated using the normal brace expansion rules.  There's no
_arguments magic involved.

} my question is how I can exclude any options. The normal
} approach of
} 
} '(-v)-h[print help and exit]'
} 
} does not work, presumably because the -{h,-help} is outside of
} the single ticks.

It should work to do

  '(-v)'-{h,-help}'[print help and exit]'

which just means

  '(-v)-h[print help and exit]'
  '(-v)--help[print help and exit]'

} Also, is there a way to use wildcards in the exclusion part at
} the beginning?

No.  You can use (*) as a special case, meaning "the following may
not appear if there are any non-option arguments already on the line",
but otherwise you must make an explicit enumeration of the excusions.



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