From 18d51669ac55efc02b8f1fbdffd9d7ff8ddbcd18 Mon Sep 17 00:00:00 2001 From: Joe Bloggs Date: Thu, 10 Jul 2014 20:00:41 +0100 Subject: [PATCH] Added extra notes about _arguments --- zsh-completions-howto.org | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/zsh-completions-howto.org b/zsh-completions-howto.org index 2629ea2..4866d50 100644 --- a/zsh-completions-howto.org +++ b/zsh-completions-howto.org @@ -194,10 +194,11 @@ this will complete the items in $userdirs, aswell as a comma separated list cont As with _describe, the _alternative function can itself be used in an ACTION as part of a specification for _arguments or _regex_arguments. ** Writing completion functions using _arguments -With the _arguments function you can create more sophisticated completion functions. +With the _arguments function you can create more sophisticated completion functions for handling both options and arguments. Like the _alternative function, _arguments takes a list of specification strings as arguments. These specification strings can be for specifying options and any corresponding option arguments (e.g. -f filename), -or command arguments. +or command arguments. When listing completions command arguments will be shown, unless there is a hyphen on the command line +in which case options will be listed. Basic option specifications take the form '-OPT[DESCRIPTION]', e.g. like this: #+BEGIN_SRC sh