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

Re: PATCH: Re: Assorted _arguments arguments



On May 11, 10:52am, Sven Wischnowsky wrote:
} Subject: PATCH: Re: Assorted _arguments arguments
}
} I said that I was thinking about using something like _argument_sets
} for this. But, why not use _argument_sets itself? This allows the
} set-strings be given as `(name)' meaning that all specifications in
} that set are mutually exclusive with all other specs in the set. They
} are mutually exclusive with the set in which they are, so to say.
} 
} Example:
} 
}   _argument_sets \
}       -common -options ':and:(arguments)' \
}     - '(compress)' \
}       {-c,--compress}'[compress]' \
}     - '(decompress)' \
}       {-d,--decompress}'[decompress]'
} 
} Is that convenient enough?

I haven't really worked at understanding _argument_sets very much, but:

As I understand it, _argument_sets only works for fairly simple option
combinations.  As soon as you start needing ->state and the like, it's
necessary to revert to using _arguments directly.  Is it possible to
combine the two in some useful way so that it isn't necessary to give
up the above convenience in order to do more complex parsing?

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



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