{
    "mode": "info",
    "parameter": "zshcompsys",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/info/zshcompsys/json",
    "generated": "2026-07-05T13:12:59Z",
    "sections": {
        "NAME": {
            "content": "zshcompsys - zsh completion system\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "This describes the shell code for the `new' completion system, referred\nto as compsys.  It is written in shell functions based on the  features\ndescribed in zshcompwid(1).\n\nThe features are contextual, sensitive to the point at which completion\nis started.  Many completions are already provided.  For this reason, a\nuser  can perform a great many tasks without knowing any details beyond\nhow to initialize the system, which is described below  in  INITIALIZA-\nTION.\n\nThe context that decides what completion is to be performed may be\no      an  argument  or option position: these describe the position on\nthe command line at which completion is requested.  For  example\n`first  argument  to rmdir, the word being completed names a di-\nrectory';\n\no      a special context, denoting an element in  the  shell's  syntax.\nFor  example  `a  word  in  command  position' or `an array sub-\nscript'.\n\nA full context specification contains other elements, as we  shall  de-\nscribe.\n\nBesides  commands  names and contexts, the system employs two more con-\ncepts, styles and tags.  These provide ways for the user  to  configure\nthe system's behaviour.\n\nTags  play  a dual role.  They serve as a classification system for the\nmatches, typically indicating a class of object that the user may  need\nto  distinguish.  For example, when completing arguments of the ls com-\nmand the user may prefer to try files before directories,  so  both  of\nthese are tags.  They also appear as the rightmost element in a context\nspecification.\n\nStyles modify various operations of the completion system, such as out-\nput formatting, but also what kinds of completers are used (and in what\norder), or which tags are examined.  Styles may  accept  arguments  and\nare  manipulated  using  the  zstyle  command  described in see zshmod-\nules(1).\n\nIn summary, tags describe what the completion objects  are,  and  style\nhow they are to be completed.  At various points of execution, the com-\npletion system checks what styles and/or tags are defined for the  cur-\nrent  context, and uses that to modify its behavior.  The full descrip-\ntion of context handling, which determines how tags and other  elements\nof the context influence the behaviour of styles, is described below in\nCOMPLETION SYSTEM CONFIGURATION.\n\nWhen a completion is requested, a dispatcher function  is  called;  see\nthe  description of maincomplete in the list of control functions be-\nlow. This dispatcher decides which function should be called to produce\nthe completions, and calls it. The result is passed to one or more com-\npleters, functions that  implement  individual  completion  strategies:\nsimple  completion, error correction, completion with error correction,\nmenu selection, etc.\n\nMore generally, the shell functions contained in the completion  system\nare of two types:\no      those beginning `comp' are to be called directly; there are only\na few of these;\n\no      those beginning `' are called  by  the  completion  code.   The\nshell  functions  of this set, which implement completion behav-\niour and may be bound to keystrokes, are referred  to  as  `wid-\ngets'.  These proliferate as new completions are required.\n",
            "subsections": []
        },
        "INITIALIZATION": {
            "content": "If the system was installed completely, it should be enough to call the\nshell function compinit from your initialization  file;  see  the  next\nsection.   However,  the  function  compinstall can be run by a user to\nconfigure various aspects of the completion system.\n\nUsually, compinstall will insert code into .zshrc, although if that  is\nnot  writable  it will save it in another file and tell you that file's\nlocation.  Note that it is up to you to make sure that the lines  added\nto  .zshrc are actually run; you may, for example, need to move them to\nan earlier place in the file if .zshrc usually returns early.  So  long\nas you keep them all together (including the comment lines at the start\nand finish), you can rerun compinstall and it will correctly locate and\nmodify  these lines.  Note, however, that any code you add to this sec-\ntion by hand is likely to be lost if you  rerun  compinstall,  although\nlines using the command `zstyle' should be gracefully handled.\n\nThe  new  code  will  take effect next time you start the shell, or run\n.zshrc by hand; there is also an option to make them take effect  imme-\ndiately.   However,  if  compinstall  has removed definitions, you will\nneed to restart the shell to see the changes.\n\nTo run compinstall you will need to make sure it is in a directory men-\ntioned in your fpath parameter, which should already be the case if zsh\nwas properly configured as long as your startup files do not remove the\nappropriate  directories  from fpath.  Then it must be autoloaded (`au-\ntoload -U compinstall' is recommended).  You can abort the installation\nany  time  you are being prompted for information, and your .zshrc will\nnot be altered at all; changes only take place right at the end,  where\nyou are specifically asked for confirmation.\n\nUse of compinit\nThis section describes the use of compinit to initialize completion for\nthe current session when called directly; if you have  run  compinstall\nit will be called automatically from your .zshrc.\n\nTo  initialize  the system, the function compinit should be in a direc-\ntory mentioned in the fpath parameter, and should be  autoloaded  (`au-\ntoload -U compinit' is recommended), and then run simply as `compinit'.\nThis will define a few utility functions, arrange for all the necessary\nshell  functions  to be autoloaded, and will then re-define all widgets\nthat do completion to use the new system.  If you use  the  menu-select\nwidget,  which is part of the zsh/complist module, you should make sure\nthat that module is loaded before the call to  compinit  so  that  that\nwidget is also re-defined.  If completion styles (see below) are set up\nto perform expansion as well as completion by default, and the TAB  key\nis  bound  to  expand-or-complete,  compinit  will  rebind  it  to com-\nplete-word; this is necessary to use the correct form of expansion.\n\nShould you need to use the original completion commands, you can  still\nbind  keys  to  the old widgets by putting a `.' in front of the widget\nname, e.g. `.expand-or-complete'.\n\nTo speed up the running of compinit, it can be made to produce a dumped\nconfiguration  that  will be read in on future invocations; this is the\ndefault, but can be turned off by calling compinit with the option  -D.\nThe  dumped  file  is  .zcompdump  in the same directory as the startup\nfiles (i.e. $ZDOTDIR or $HOME); alternatively, an  explicit  file  name\ncan  be  given  by  `compinit  -d  dumpfile'.   The  next invocation of\ncompinit will read the dumped file instead of performing  a  full  ini-\ntialization.\n\nIf the number of completion files changes, compinit will recognise this\nand produce a new dump file.  However, if the name of a function or the\narguments in the first line of a #compdef function (as described below)\nchange, it is easiest to delete the dump file by hand so that  compinit\nwill  re-create it the next time it is run.  The check performed to see\nif there are new functions can be omitted by giving the option -C.   In\nthis  case  the  dump  file will only be created if there isn't one al-\nready.\n\nThe dumping is actually done by another  function,  compdump,  but  you\nwill  only  need  to  run this yourself if you change the configuration\n(e.g. using compdef) and then want to dump the new one.   The  name  of\nthe old dumped file will be remembered for this purpose.\n\nIf the parameter compdir is set, compinit uses it as a directory where\ncompletion functions can be found; this is only necessary if  they  are\nnot already in the function search path.\n\nFor  security  reasons  compinit  also  checks if the completion system\nwould use files not owned by root or by the current user, or  files  in\ndirectories  that are world- or group-writable or that are not owned by\nroot or by the current user.  If such files or directories  are  found,\ncompinit  will  ask if the completion system should really be used.  To\navoid these tests and make all files found be used without asking,  use\nthe  option -u, and to make compinit silently ignore all insecure files\nand directories use the option -i.  This security check is skipped  en-\ntirely when the -C option is given.\n\nThe  security  check can be retried at any time by running the function\ncompaudit.  This is the same check used by compinit, but when it is ex-\necuted  directly any changes to fpath are made local to the function so\nthey do not persist.  The directories to be checked may  be  passed  as\narguments; if none are given, compaudit uses fpath and compdir to find\ncompletion system directories, adding missing ones to fpath  as  neces-\nsary.   To  force a check of exactly the directories currently named in\nfpath, set compdir to an empty  string  before  calling  compaudit  or\ncompinit.\n\nThe  function  bashcompinit provides compatibility with bash's program-\nmable completion system.  When run it will define the functions,  comp-\ngen  and  complete  which correspond to the bash builtins with the same\nnames.  It will then be possible to use completion  specifications  and\nfunctions written for bash.\n\nAutoloaded files\nThe convention for autoloaded functions used in completion is that they\nstart with an underscore; as already mentioned, the fpath/FPATH parame-\nter  must  contain  the directory in which they are stored.  If zsh was\nproperly installed on your system, then fpath/FPATH automatically  con-\ntains the required directories for the standard functions.\n\nFor  incomplete  installations,  if compinit does not find enough files\nbeginning with an underscore (fewer than twenty) in the search path, it\nwill  try  to  find more by adding the directory compdir to the search\npath.  If that directory has a subdirectory named Base, all subdirecto-\nries  will be added to the path.  Furthermore, if the subdirectory Base\nhas a subdirectory named Core, compinit will add all subdirectories  of\nthe  subdirectories to the path: this allows the functions to be in the\nsame format as in the zsh source distribution.\n\nWhen compinit is  run,  it  searches  all  such  files  accessible  via\nfpath/FPATH and reads the first line of each of them.  This line should\ncontain one of the tags described below.  Files whose first  line  does\nnot  start  with one of these tags are not considered to be part of the\ncompletion system and will not be treated specially.\n\nThe tags are:\n\n#compdef name ... [ -{p|P} pattern ... [ -N name ... ] ]\nThe file will be made autoloadable and the function  defined  in\nit will be called when completing names, each of which is either\nthe name of a command whose arguments are to be completed or one\nof  a number of special contexts in the form -context- described\nbelow.\n\nEach name may also be of the form `cmd=service'.  When  complet-\ning  the  command  cmd, the function typically behaves as if the\ncommand (or special context) service  was  being  completed  in-\nstead.   This  provides a way of altering the behaviour of func-\ntions that can perform many different completions.  It is imple-\nmented  by setting the parameter $service when calling the func-\ntion; the function may choose to interpret this how  it  wishes,\nand simpler functions will probably ignore it.\n\nIf  the  #compdef line contains one of the options -p or -P, the\nwords following are taken to be patterns.  The function will  be\ncalled  when  completion  is  attempted for a command or context\nthat matches one of the patterns.  The options  -p  and  -P  are\nused  to specify patterns to be tried before or after other com-\npletions respectively.  Hence -P may be used to specify  default\nactions.\n\nThe option -N is used after a list following -p or -P; it speci-\nfies that remaining words no longer define patterns.  It is pos-\nsible  to toggle between the three options as many times as nec-\nessary.\n\n#compdef -k style key-sequence ...\nThis option creates a widget behaving like  the  builtin  widget\nstyle  and  binds  it  to  the given key-sequences, if any.  The\nstyle must be one of the builtin widgets  that  perform  comple-\ntion,  namely complete-word, delete-char-or-list, expand-or-com-\nplete, expand-or-complete-prefix,  list-choices,  menu-complete,\nmenu-expand-or-complete,   or   reverse-menu-complete.   If  the\nzsh/complist module is loaded  (see  zshmodules(1))  the  widget\nmenu-select is also available.\n\nWhen one of the key-sequences is typed, the function in the file\nwill be invoked to generate the matches.  Note that a  key  will\nnot  be  re-bound if it already was (that is, was bound to some-\nthing other than undefined-key).  The  widget  created  has  the\nsame  name  as the file and can be bound to any other keys using\nbindkey as usual.\n\n#compdef -K widget-name style key-sequence [ name style seq ... ]\nThis is similar to -k except that only one key-sequence argument\nmay  be given for each widget-name style pair.  However, the en-\ntire set of three arguments may be repeated with a different set\nof  arguments.   Note in particular that the widget-name must be\ndistinct in each set.  If it does not begin with `'  this  will\nbe added.  The widget-name should not clash with the name of any\nexisting widget: names based on the name  of  the  function  are\nmost useful.  For example,\n\n#compdef -K foocomplete complete-word \"^X^C\" \\\nfoolist list-choices \"^X^D\"\n\n(all on one line) defines a widget foocomplete for completion,\nbound to `^X^C', and a widget foolist for  listing,  bound  to\n`^X^D'.\n\n#autoload [ options ]\nFunctions  with the #autoload tag are marked for autoloading but\nare not otherwise treated specially.  Typically they are  to  be\ncalled from within one of the completion functions.  Any options\nsupplied will be passed to the autoload builtin; a  typical  use\nis +X to force the function to be loaded immediately.  Note that\nthe -U and -z flags are always added implicitly.\n\nThe # is part of the tag name and no white space is allowed  after  it.\nThe  #compdef  tags  use the compdef function described below; the main\ndifference is that the name of the function is supplied implicitly.\n\nThe special contexts for which completion functions can be defined are:\n",
            "subsections": [
                {
                    "name": "-array-value-",
                    "content": "The right hand side of an array-assignment (`name=(...)')\n"
                },
                {
                    "name": "-brace-parameter-",
                    "content": "The name of a parameter expansion within braces (`${...}')\n"
                },
                {
                    "name": "-assign-parameter-",
                    "content": "The name of a parameter in an assignment, i.e. on the left  hand\nside of an `='\n"
                },
                {
                    "name": "-command-",
                    "content": "A word in command position\n"
                },
                {
                    "name": "-condition-",
                    "content": "A word inside a condition (`[[...]]')\n"
                },
                {
                    "name": "-default-",
                    "content": "Any word for which no other completion is defined\n"
                },
                {
                    "name": "-equal-",
                    "content": "A word beginning with an equals sign\n"
                },
                {
                    "name": "-first-",
                    "content": "This  is  tried before any other completion function.  The func-\ntion called may set the compskip parameter to  one  of  various\nvalues:  all:  no further completion is attempted; a string con-\ntaining the substring patterns: no pattern completion  functions\nwill  be  called;  a string containing default: the function for\nthe `-default-' context will not be called,  but  functions  de-\nfined for commands will be.\n\n-math- Inside mathematical contexts, such as `((...))'\n"
                },
                {
                    "name": "-parameter-",
                    "content": "The name of a parameter expansion (`$...')\n"
                },
                {
                    "name": "-redirect-",
                    "content": "The word after a redirection operator.\n"
                },
                {
                    "name": "-subscript-",
                    "content": "The contents of a parameter subscript.\n"
                },
                {
                    "name": "-tilde-",
                    "content": "After  an initial tilde (`~'), but before the first slash in the\nword.\n"
                },
                {
                    "name": "-value-",
                    "content": "On the right hand side of an assignment.\n\nDefault implementations are supplied for each of  these  contexts.   In\nmost  cases  the  context  -context-  is implemented by a corresponding\nfunction context, for example the context `-tilde-' and  the  function\n`tilde').\n\nThe contexts -redirect- and -value- allow extra context-specific infor-\nmation.  (Internally, this is handled by the functions for each context\ncalling  the function dispatch.)  The extra information is added sepa-\nrated by commas.\n\nFor the -redirect- context, the extra information is in the form  `-re-\ndirect-,op,command',  where  op is the redirection operator and command\nis the name of the command on the line.  If there is no command on  the\nline yet, the command field will be empty.\n\nFor the -value- context, the form is `-value-,name,command', where name\nis the name of the parameter on the left hand side of  the  assignment.\nIn  the  case  of  elements  of  an associative array, for example `as-\nsoc=(key <TAB>', name is expanded to `name-key'.   In  certain  special\ncontexts,  such  as  completing  after `make CFLAGS=', the command part\ngives the name of the command, here make; otherwise it is empty.\n\nIt is not necessary to define fully specific completions as  the  func-\ntions  provided  will  try to generate completions by progressively re-\nplacing the elements with `-default-'.  For  example,  when  completing\nafter  `foo=<TAB>',  value will try the names `-value-,foo,' (note the\nempty command part), `-value-,foo,-default-' and`-value-,-default-,-de-\nfault-',  in  that  order, until it finds a function to handle the con-\ntext.\n\nAs an example:\n\ncompdef 'files -g \"*.log\"' '-redirect-,2>,-default-'\n\ncompletes files matching `*.log' after `2> <TAB>' for any command  with\nno more specific handler defined.\n\nAlso:\n\ncompdef foo -value-,-default-,-default-\n\nspecifies  that  foo provides completions for the values of parameters\nfor which no special function has been defined.  This is  usually  han-\ndled by the function value itself.\n\nThe same lookup rules are used when looking up styles (as described be-\nlow); for example\n\nzstyle ':completion:*:*:-redirect-,2>,*:*' file-patterns '*.log'\n\nis another way to make  completion  after  `2>  <TAB>'  complete  files\nmatching `*.log'.\n\nFunctions\nThe  following  function  is  defined by compinit and may be called di-\nrectly.\n\ncompdef [ -ane ] function name ... [ -{p|P} pattern ... [ -N name ...]]\ncompdef -d name ...\ncompdef -k [ -an ] function style key-sequence [ key-sequence ... ]\ncompdef -K [ -an ] function name style key-seq [ name style seq ... ]\nThe first form defines the function to call  for  completion  in\nthe given contexts as described for the #compdef tag above.\n\nAlternatively,  all  the  arguments  may have the form `cmd=ser-\nvice'.   Here  service  should  already  have  been  defined  by\n`cmd1=service' lines in #compdef files, as described above.  The\nargument for cmd will be completed in the same way as service.\n\nThe function argument may alternatively be a  string  containing\nalmost  any  shell  code.  If the string contains an equal sign,\nthe above will take precedence.  The option -e may  be  used  to\nspecify the first argument is to be evaluated as shell code even\nif it contains an equal sign.  The string will be executed using\nthe eval builtin command to generate completions.  This provides\na way of avoiding having to define a  new  completion  function.\nFor  example,  to  complete files ending in `.h' as arguments to\nthe command foo:\n\ncompdef 'files -g \"*.h\"' foo\n\nThe option -n prevents any completions already defined  for  the\ncommand or context from being overwritten.\n\nThe  option -d deletes any completion defined for the command or\ncontexts listed.\n\nThe names may also contain -p, -P and -N  options  as  described\nfor  the #compdef tag.  The effect on the argument list is iden-\ntical, switching between  definitions  of  patterns  tried  ini-\ntially,  patterns  tried  finally,  and normal commands and con-\ntexts.\n\nThe parameter $compskip may be set by any function defined  for\na  pattern context.  If it is set to a value containing the sub-\nstring `patterns' none of the pattern-functions will be  called;\nif it is set to a value containing the substring `all', no other\nfunction will be called.  Setting $compskip in this  manner  is\nof particular utility when using the -p option, as otherwise the\ndispatcher will move on to additional functions (likely the  de-\nfault one) after calling the pattern-context one, which can man-\ngle the display of completion possibilities if not handled prop-\nerly.\n\nThe  form  with  -k  defines  a widget with the same name as the\nfunction that will be called for each of the key-sequences; this\nis  like  the #compdef -k tag.  The function should generate the\ncompletions needed and will otherwise behave  like  the  builtin\nwidget  whose  name is given as the style argument.  The widgets\nusable for this  are:  complete-word,  delete-char-or-list,  ex-\npand-or-complete,    expand-or-complete-prefix,    list-choices,\nmenu-complete,  menu-expand-or-complete,  and  reverse-menu-com-\nplete,  as  well  as  menu-select  if the zsh/complist module is\nloaded.  The option -n prevents the key being bound if it is al-\nready to bound to something other than undefined-key.\n\nThe  form  with -K is similar and defines multiple widgets based\non the same function, each of which requires the  set  of  three\narguments name, style and key-sequence, where the latter two are\nas for -k and the first must be a unique widget  name  beginning\nwith an underscore.\n\nWherever  applicable, the -a option makes the function autoload-\nable, equivalent to autoload -U function.\n\nThe function compdef can be used to associate existing completion func-\ntions with new commands.  For example,\n\ncompdef pids foo\n\nuses the function pids to complete process IDs for the command foo.\n\nNote  also the gnugeneric function described below, which can be used\nto complete options for commands that understand the `--help' option.\n"
                }
            ]
        },
        "COMPLETION SYSTEM CONFIGURATION": {
            "content": "This section gives a short overview of how the completion system works,\nand  then  more  detail on how users can configure how and when matches\nare generated.\n\nOverview\nWhen completion is attempted somewhere on the command line the  comple-\ntion system begins building the context.  The context represents every-\nthing that the shell knows about the meaning of the  command  line  and\nthe  significance of the cursor position.  This takes account of a num-\nber of things including the command word (such as `grep' or `zsh')  and\noptions  to which the current word may be an argument (such as the `-o'\noption to zsh which takes a shell option as an argument).\n\nThe context starts out very generic (\"we are beginning  a  completion\")\nand becomes more specific as more is learned (\"the current word is in a\nposition that is usually a command name\" or \"the current word might  be\na  variable  name\"  and so on).  Therefore the context will vary during\nthe same call to the completion system.\n\nThis context information is condensed into a string consisting of  mul-\ntiple  fields  separated by colons, referred to simply as `the context'\nin the remainder of the documentation.  Note that a user of the comple-\ntion  system rarely needs to compose a context string, unless for exam-\nple a new function is being written to perform  completion  for  a  new\ncommand.   What a user may need to do is compose a style pattern, which\nis matched against a context when needed to look  up  context-sensitive\noptions that configure the completion system.\n\nThe  next  few  paragraphs explain how a context is composed within the\ncompletion function suite.  Following that is discussion of how  styles\nare  defined.  Styles determine such things as how the matches are gen-\nerated, similarly to shell options but with much  more  control.   They\nare defined with the zstyle builtin command (see zshmodules(1)).\n\nThe  context string always consists of a fixed set of fields, separated\nby colons and with a leading colon before the first.  Fields which  are\nnot yet known are left empty, but the surrounding colons appear anyway.\nThe fields are always in the order  :completion:function:completer:com-\nmand:argument:tag.  These have the following meaning:\n\no      The literal string completion, saying that this style is used by\nthe completion system.   This  distinguishes  the  context  from\nthose used by, for example, zle widgets and ZFTP functions.\n\no      The function, if completion is called from a named widget rather\nthan through the normal completion system.   Typically  this  is\nblank,  but  it is set by special widgets such as predict-on and\nthe various functions in the Widget directory of  the  distribu-\ntion to the name of that function, often in an abbreviated form.\n\no      The completer currently active, the name of the function without\nthe leading underscore and with other underscores  converted  to\nhyphens.   A `completer' is in overall control of how completion\nis to be performed; `complete' is the simplest, but  other  com-\npleters exist to perform related tasks such as correction, or to\nmodify the behaviour of a  later  completer.   See  the  section\n`Control Functions' below for more information.\n\no      The command or a special -context-, just at it appears following\nthe #compdef tag or the compdef function.  Completion  functions\nfor commands that have sub-commands usually modify this field to\ncontain the name of the command followed by a minus sign and the\nsub-command.   For  example, the completion function for the cvs\ncommand sets this field to cvs-add when completing arguments  to\nthe add subcommand.\n\no      The  argument; this indicates which command line or option argu-\nment we are completing.  For command  arguments  this  generally\ntakes  the  form  argument-n, where n is the number of the argu-\nment, and for arguments to options the form option-opt-n where n\nis  the  number of the argument to option opt.  However, this is\nonly the case if  the  command  line  is  parsed  with  standard\nUNIX-style options and arguments, so many completions do not set\nthis.\n\no      The tag.  As described previously, tags are used to discriminate\nbetween  the types of matches a completion function can generate\nin a certain context.  Any completion function may use  any  tag\nname  it  likes, but a list of the more common ones is given be-\nlow.\n\nThe context is gradually put together as the  functions  are  executed,\nstarting  with  the  main  entry point, which adds :completion: and the\nfunction element if necessary.  The completer then adds  the  completer\nelement.   The  contextual completion adds the command and argument op-\ntions.  Finally, the tag is added when  the  types  of  completion  are\nknown.  For example, the context name\n\n:completion::complete:dvips:option-o-1:files\n\nsays  that normal completion was attempted as the first argument to the\noption -o of the command dvips:\n\ndvips -o ...\n\nand the completion function will generate filenames.\n\nUsually completion will be tried for all  possible  tags  in  an  order\ngiven  by the completion function.  However, this can be altered by us-\ning the tag-order style.  Completion is then restricted to the list  of\ngiven tags in the given order.\n\nThe  completehelp  bindable  command  shows all the contexts and tags\navailable for completion at a particular point.  This provides an  easy\nway  of  finding information for tag-order and other styles.  It is de-\nscribed in the section `Bindable Commands' below.\n\nWhen looking up styles the completion system uses full  context  names,\nincluding  the tag.  Looking up the value of a style therefore consists\nof two things: the context, which is matched to the most specific (best\nfitting) style pattern, and the name of the style itself, which must be\nmatched exactly.  The following examples demonstrate  that  style  pat-\nterns  may  be  loosely  defined  for  styles that apply broadly, or as\ntightly defined as desired for styles that apply  in  narrower  circum-\nstances.\n\nFor example, many completion functions can generate matches in a simple\nand a verbose form and use the  verbose  style  to  decide  which  form\nshould be used.  To make all such functions use the verbose form, put\n\nzstyle ':completion:*' verbose yes\n\nin  a startup file (probably .zshrc).  This gives the verbose style the\nvalue yes in every context inside the completion  system,  unless  that\ncontext has a more specific definition.  It is best to avoid giving the\ncontext as `*' in case the style has some meaning outside  the  comple-\ntion system.\n\nMany  such general purpose styles can be configured simply by using the\ncompinstall function.\n\nA more specific example of the use of the verbose style is by the  com-\npletion  for  the kill builtin.  If the style is set, the builtin lists\nfull job texts and process command lines; otherwise it shows  the  bare\njob numbers and PIDs.  To turn the style off for this use only:\n\nzstyle ':completion:*:*:kill:*:*' verbose no\n\nFor  even  more  control,  the  style can use one of the tags `jobs' or\n`processes'.  To turn off verbose display only for jobs:\n\nzstyle ':completion:*:*:kill:*:jobs' verbose no\n\nThe -e option to zstyle even allows completion function code to  appear\nas the argument to a style; this requires some understanding of the in-\nternals of completion functions (see see zshcompwid(1))).  For example,\n\nzstyle -e ':completion:*' hosts 'reply=($myhosts)'\n\nThis forces the value of the hosts style to be read from  the  variable\nmyhosts each time a host name is needed; this is useful if the value of\nmyhosts can change dynamically.  For another useful  example,  see  the\nexample in the description of the file-list style below.  This form can\nbe slow and should be avoided for commonly examined styles such as menu\nand list-rows-first.\n\nNote  that  the  order in which styles are defined does not matter; the\nstyle mechanism uses the most specific possible match for a  particular\nstyle to determine the set of values.  More precisely, strings are pre-\nferred over patterns  (for  example,  `:completion::complete:::foo'  is\nmore  specific  than  `:completion::complete:::*'), and longer patterns\nare preferred over shorter patterns.\n\nA good rule of thumb is that any completion style pattern that needs to\ninclude more than one wildcard (*) and that does not end in a tag name,\nshould include all six  colons  (:),  possibly  surrounding  additional\nwildcards.\n\nStyle  names like those of tags are arbitrary and depend on the comple-\ntion function.  However, the following two sections list  some  of  the\nmost common tags and styles.\n\nStandard Tags\nSome  of  the following are only used when looking up particular styles\nand do not refer to a type of match.\n\naccounts\nused to look up the users-hosts style\n\nall-expansions\nused by the expand completer when adding the single string con-\ntaining all possible expansions\n\nall-files\nfor  the  names of all files (as distinct from a particular sub-\nset, see the globbed-files tag).\n\narguments\nfor arguments to a command\n\narrays for names of array parameters\n\nassociation-keys\nfor keys of associative arrays; used when  completing  inside  a\nsubscript to a parameter of this type\n\nbookmarks\nwhen  completing  bookmarks (e.g. for URLs and the zftp function\nsuite)\n\nbuiltins\nfor names of builtin commands\n\ncharacters\nfor single characters in arguments of  commands  such  as  stty.\nAlso  used  when  completing  character classes after an opening\nbracket\n\ncolormapids\nfor X colormap ids\n\ncolors for color names\n\ncommands\nfor names of external commands.  Also used by  complex  commands\nsuch as cvs when completing names subcommands.\n\ncontexts\nfor contexts in arguments to the zstyle builtin command\n\ncorrections\nused  by  the  approximate and correct completers for possible\ncorrections\n\ncursors\nfor cursor names used by X programs\n\ndefault\nused in some contexts to provide a way of  supplying  a  default\nwhen  more  specific tags are also valid.  Note that this tag is\nused when only the function field of the context name is set\n\ndescriptions\nused when looking up the value of the format style  to  generate\ndescriptions for types of matches\n\ndevices\nfor names of device special files\n\ndirectories\nfor  names  of  directories -- local-directories is used instead\nwhen completing arguments of cd  and  related  builtin  commands\nwhen the cdpath array is set\n\ndirectory-stack\nfor entries in the directory stack\n\ndisplays\nfor X display names\n\ndomains\nfor network domains\n\nemail-plugin\nfor   email   addresses  from  the  `email-plugin'  backend  of\nemailaddresses\n\nexpansions\nused by the expand completer for individual words  (as  opposed\nto  the complete set of expansions) resulting from the expansion\nof a word on the command line\n\nextensions\nfor X server extensions\n\nfile-descriptors\nfor numbers of open file descriptors\n\nfiles  the generic file-matching tag used by functions completing file-\nnames\n\nfonts  for X font names\n\nfstypes\nfor file system types (e.g. for the mount command)\n\nfunctions\nnames of functions -- normally shell functions, although certain\ncommands may understand other kinds of function\n\nglobbed-files\nfor filenames when the name has been generated by pattern match-\ning\n\ngroups for names of user groups\n\nhistory-words\nfor words from the history\n\nhosts  for hostnames\n\nindexes\nfor array indexes\n\njobs   for jobs (as listed by the `jobs' builtin)\n\ninterfaces\nfor network interfaces\n\nkeymaps\nfor names of zsh keymaps\n\nkeysyms\nfor names of X keysyms\n\nlibraries\nfor names of system libraries\n\nlimits for system limits\n\nlocal-directories\nfor  names of directories that are subdirectories of the current\nworking directory when completing arguments of  cd  and  related\nbuiltin  commands  (compare path-directories) -- when the cdpath\narray is unset, directories is used instead\n\nmanuals\nfor names of manual pages\n\nmailboxes\nfor e-mail folders\n\nmaps   for map names (e.g. NIS maps)\n\nmessages\nused to look up the format style for messages\n\nmodifiers\nfor names of X modifiers\n\nmodules\nfor modules (e.g. zsh modules)\n\nmy-accounts\nused to look up the users-hosts style\n\nnamed-directories\nfor named directories (you wouldn't  have  guessed  that,  would\nyou?)\n\nnames  for all kinds of names\n\nnewsgroups\nfor USENET groups\n\nnicknames\nfor nicknames of NIS maps\n\noptions\nfor command options\n\noriginal\nused  by  the approximate, correct and expand completers when\noffering the original string as a match\n\nother-accounts\nused to look up the users-hosts style\n\nother-files\nfor the names of any non-directory files.  This is used  instead\nof all-files when the list-dirs-first style is in effect.\n\npackages\nfor packages (e.g. rpm or installed Debian packages)\n\nparameters\nfor names of parameters\n\npath-directories\nfor  names  of  directories  found by searching the cdpath array\nwhen completing arguments of cd  and  related  builtin  commands\n(compare local-directories)\n\npaths  used  to  look  up  the values of the expand, ambiguous and spe-\ncial-dirs styles\n\npods   for perl pods (documentation files)\n\nports  for communication ports\n\nprefixes\nfor prefixes (like those of a URL)\n\nprinters\nfor print queue names\n\nprocesses\nfor process identifiers\n\nprocesses-names\nused to look up the command style when generating the  names  of\nprocesses for killall\n\nsequences\nfor sequences (e.g. mh sequences)\n\nsessions\nfor sessions in the zftp function suite\n\nsignals\nfor signal names\n\nstrings\nfor  strings  (e.g.  the  replacement strings for the cd builtin\ncommand)\n\nstyles for styles used by the zstyle builtin command\n\nsuffixes\nfor filename extensions\n\ntags   for tags (e.g. rpm tags)\n\ntargets\nfor makefile targets\n\ntime-zones\nfor time zones (e.g. when setting the TZ parameter)\n\ntypes  for types of whatever (e.g. address types for the xhost command)\n\nurls   used to look up the urls and local styles when completing URLs\n\nusers  for usernames\n\nvalues for one of a set of values in certain lists\n\nvariant\nused by pickvariant to look up the command to run when  deter-\nmining what program is installed for a particular command name.\n\nvisuals\nfor X visuals\n\nwarnings\nused to look up the format style for warnings\n\nwidgets\nfor zsh widget names\n\nwindows\nfor IDs of X windows\n\nzsh-options\nfor shell options\n\nStandard Styles\nNote  that the values of several of these styles represent boolean val-\nues.  Any of the strings `true', `on', `yes', and `1' can be  used  for\nthe  value  `true' and any of the strings `false', `off', `no', and `0'\nfor the value `false'.  The behavior for any other value  is  undefined\nexcept  where  explicitly  mentioned.   The default value may be either\n`true' or `false' if the style is not set.\n\nSome of these styles are tested first for  every  possible  tag  corre-\nsponding to a type of match, and if no style was found, for the default\ntag.  The most notable styles of this type are  menu,  list-colors  and\nstyles   controlling   completion   listing  such  as  list-packed  and\nlast-prompt.  When tested for the default tag, only the function  field\nof  the  context will be set so that a style using the default tag will\nnormally be defined along the lines of:\n\nzstyle ':completion:*:default' menu ...\n\naccept-exact\nThis is tested for the default tag in addition to the tags valid\nfor  the current context.  If it is set to `true' and any of the\ntrial matches is the same as the string  on  the  command  line,\nthis match will immediately be accepted (even if it would other-\nwise be considered ambiguous).\n\nWhen completing pathnames (where the tag used is  `paths')  this\nstyle accepts any number of patterns as the value in addition to\nthe boolean values.  Pathnames matching one  of  these  patterns\nwill  be  accepted immediately even if the command line contains\nsome more partially typed pathname components and these match no\nfile under the directory accepted.\n\nThis  style  is  also used by the expand completer to decide if\nwords beginning with a tilde or parameter  expansion  should  be\nexpanded.   For example, if there are parameters foo and foobar,\nthe string `$foo' will only be expanded if accept-exact  is  set\nto  `true';  otherwise  the completion system will be allowed to\ncomplete $foo to $foobar. If the style  is  set  to  `continue',\nexpand  will  add  the  expansion as a match and the completion\nsystem will also be allowed to continue.\n\naccept-exact-dirs\nThis is used by filename completion.  Unlike accept-exact it  is\na  boolean.  By default, filename completion examines all compo-\nnents of a path to see if there are completions of  that  compo-\nnent,  even if the component matches an existing directory.  For\nexample, when completion after /usr/bin/, the function  examines\npossible completions to /usr.\n\nWhen  this style is `true', any prefix of a path that matches an\nexisting directory is accepted without any attempt  to  complete\nit  further.  Hence, in the given example, the path /usr/bin/ is\naccepted immediately and completion tried in that directory.\n\nThis style is also useful when completing after directories that\nmagically  appear  when referenced, such as ZFS .zfs directories\nor NetApp .snapshot directories.  When  the  style  is  set  the\nshell  does  not check for the existence of the directory within\nthe parent directory.\n\nIf  you  wish  to  inhibit  this  behaviour  entirely,  set  the\npath-completion style (see below) to `false'.\n\nadd-space\nThis  style  is  used by the expand completer.  If it is `true'\n(the default), a space will be inserted after all words  result-\ning  from  the  expansion,  or  a slash in the case of directory\nnames.  If the value is `file', the completer will  only  add  a\nspace  to  names  of existing files.  Either a boolean `true' or\nthe value `file' may be combined with `subst', in which case the\ncompleter  will  not add a space to words generated from the ex-\npansion of a substitution of the form `$(...)' or `${...}'.\n\nThe prefix completer uses this style as a simple boolean  value\nto decide if a space should be inserted before the suffix.\n\nambiguous\nThis  applies  when  completing non-final components of filename\npaths, in other words those with a trailing  slash.   If  it  is\nset,  the  cursor  is  left after the first ambiguous component,\neven if menu completion is in use.  The style is  always  tested\nwith the paths tag.\n\nassign-list\nWhen completing after an equals sign that is being treated as an\nassignment, the completion system normally  completes  only  one\nfilename.   In  some cases the value  may be a list of filenames\nseparated by colons, as with PATH and similar parameters.   This\nstyle  can  be  set  to a list of patterns matching the names of\nsuch parameters.\n\nThe default is to complete lists when the word on the  line  al-\nready contains a colon.\n\nauto-description\nIf  set,  this style's value will be used as the description for\noptions that are not described by the completion functions,  but\nthat  have exactly one argument.  The sequence `%d' in the value\nwill be replaced by the description for this argument.   Depend-\ning  on personal preferences, it may be useful to set this style\nto something like `specify: %d'.  Note that this  may  not  work\nfor some commands.\n\navoid-completer\nThis  is  used  by  the  allmatches completer to decide if the\nstring consisting of all matches should be  added  to  the  list\ncurrently being generated.  Its value is a list of names of com-\npleters.  If any of these is the name of the completer that gen-\nerated  the  matches  in this completion, the string will not be\nadded.\n\nThe default value for this style is `expand oldlist  correct\napproximate',  i.e.  it  contains  the  completers  for which a\nstring with all matches will almost never be wanted.\n\ncache-path\nThis style defines the path where  any  cache  files  containing\ndumped  completion  data  are  stored.   It  defaults to `$ZDOT-\nDIR/.zcompcache', or `$HOME/.zcompcache' if $ZDOTDIR is not  de-\nfined.   The  completion  cache  will  not  be  used  unless the\nuse-cache style is set.\n\ncache-policy\nThis style defines the function that will be used  to  determine\nwhether  a  cache  needs  rebuilding.   See  the  section on the\ncacheinvalid function below.\n\ncall-command\nThis style is used in the function for commands such as make and\nant  where calling the command directly to generate matches suf-\nfers problems such as being slow or, as in the case of make  can\npotentially  cause actions in the makefile to be executed. If it\nis set to `true' the command is called to generate matches.  The\ndefault value of this style is `false'.\n\ncommand\nIn  many places, completion functions need to call external com-\nmands to generate the list of completions.  This  style  can  be\nused  to override the command that is called in some such cases.\nThe elements of the value are joined with spaces to form a  com-\nmand  line  to execute.  The value can also start with a hyphen,\nin which case the usual command will be added to the  end;  this\nis  most  useful  for putting `builtin' or `command' in front to\nmake sure the appropriate version of a command  is  called,  for\nexample  to avoid calling a shell function with the same name as\nan external command.\n\nAs an example, the completion function for process IDs uses this\nstyle with the processes tag to generate the IDs to complete and\nthe list of processes  to  display  (if  the  verbose  style  is\n`true').   The list produced by the command should look like the\noutput of the ps command.  The first line is not displayed,  but\nis searched for the string `PID' (or `pid') to find the position\nof the process IDs in the following lines.  If the line does not\ncontain  `PID', the first numbers in each of the other lines are\ntaken as the process IDs to complete.\n\nNote that the completion function  generally  has  to  call  the\nspecified  command  for  each attempt to generate the completion\nlist.  Hence care should be taken to specify only commands  that\ntake  a  short  time to run, and in particular to avoid any that\nmay never terminate.\n\ncommand-path\nThis is a list of directories to search  for  commands  to  com-\nplete.   The  default for this style is the value of the special\nparameter path.\n\ncommands\nThis is used by the function  completing  sub-commands  for  the\nsystem  initialisation scripts (residing in /etc/init.d or some-\nwhere not too far away from that).  Its values give the  default\ncommands to complete for those commands for which the completion\nfunction isn't able to find them out automatically.  The default\nfor this style are the two strings `start' and `stop'.\n\ncomplete\nThis  is  used  by  the expandalias function when invoked as a\nbindable command.  If set to `true' and the word on the  command\nline  is  not the name of an alias, matching alias names will be\ncompleted.\n\ncomplete-options\nThis is used by the completer for  cd,  chdir  and  pushd.   For\nthese  commands a - is used to introduce a directory stack entry\nand completion of these is far more common than  completing  op-\ntions.   Hence  unless the value of this style is `true' options\nwill not be completed, even  after  an  initial  -.   If  it  is\n`true',  options  will  be  completed  after an initial - unless\nthere is a preceding -- on the command line.\n\ncompleter\nThe strings given as the value of this style provide  the  names\nof the completer functions to use. The available completer func-\ntions are described in the section `Control Functions' below.\n\nEach string may be either the name of a completer function or  a\nstring  of the form `function:name'.  In the first case the com-\npleter field of the context will contain the name  of  the  com-\npleter  without the leading underscore and with all other under-\nscores replaced by hyphens.  In the second case the function  is\nthe  name of the completer to call, but the context will contain\nthe user-defined name in the completer field of the context.  If\nthe  name  starts with a hyphen, the string for the context will\nbe build from the name of the completer function as in the first\ncase with the name appended to it.  For example:\n\nzstyle ':completion:*' completer complete complete:-foo\n\nHere,  completion  will call the complete completer twice, once\nusing `complete' and once using `complete-foo' in the  completer\nfield  of  the context.  Normally, using the same completer more\nthan once only makes sense when used with  the  `functions:name'\nform, because otherwise the context name will be the same in all\ncalls to the completer; possible exceptions to this rule are the\nignored and prefix completers.\n\nThe  default  value for this style is `complete ignored': only\ncompletion will be done, first using the ignored-patterns  style\nand the $fignore array and then without ignoring matches.\n\ncondition\nThis  style is used by the list completer function to decide if\ninsertion of matches should be delayed unconditionally. The  de-\nfault is `true'.\n\ndelimiters\nThis  style is used when adding a delimiter for use with history\nmodifiers or glob qualifiers that have delimited arguments.   It\nis an array of preferred delimiters to add.  Non-special charac-\nters are preferred as the completion system may otherwise become\nconfused.   The  default list is :, +, /, -, %.  The list may be\nempty to force a delimiter to be typed.\n\ndisabled\nIf this is set to `true', the expandalias completer and  bind-\nable  command will try to expand disabled aliases, too.  The de-\nfault is `false'.\n\ndomains\nA list of names of network domains for completion.  If  this  is\nnot  set,  domain  names  will  be  taken from the file /etc/re-\nsolv.conf.\n\nenviron\nThe environ style is used when completing for `sudo'.  It is set\nto  an  array of `VAR=value' assignments to be exported into the\nlocal environment before the completion for the  target  command\nis invoked.\nzstyle ':completion:*:sudo::' environ \\\nPATH=\"/sbin:/usr/sbin:$PATH\" HOME=\"/root\"\n\nexpand This  style is used when completing strings consisting of multi-\nple parts, such as path names.\n\nIf one of its values is the string `prefix', the partially typed\nword  from  the line will be expanded as far as possible even if\ntrailing parts cannot be completed.\n\nIf one of its values is the string `suffix', matching names  for\ncomponents  after  the  first  ambiguous one will also be added.\nThis means that the resulting string is the longest  unambiguous\nstring  possible.  However, menu completion can be used to cycle\nthrough all matches.\n\nfake   This style may be set for any completion context.  It  specifies\nadditional  strings  that  will always be completed in that con-\ntext.  The form of each string is `value:description'; the colon\nand  description may be omitted, but any literal colons in value\nmust be quoted with a backslash.  Any  description  provided  is\nshown alongside the value in completion listings.\n\nIt  is  important to use a sufficiently restrictive context when\nspecifying fake strings.  Note that the  styles  fake-files  and\nfake-parameters  provide  additional  features  when  completing\nfiles or parameters.\n\nfake-always\nThis works identically to the fake style  except  that  the  ig-\nnored-patterns style is not applied to it.  This makes it possi-\nble to override a set of matches completely by setting  the  ig-\nnored patterns to `*'.\n\nThe  following  shows  a way of supplementing any tag with arbi-\ntrary data, but having it behave for  display  purposes  like  a\nseparate  tag.   In  this  example  we  use  the features of the\ntag-order style to divide the  named-directories  tag  into  two\nwhen  performing completion with the standard completer complete\nfor arguments of cd.  The tag  named-directories-normal  behaves\nas  normal,  but the tag named-directories-mine contains a fixed\nset of directories.  This has the effect  of  adding  the  match\ngroup `extra directories' with the given completions.\n\nzstyle ':completion::complete:cd:*' tag-order \\\n'named-directories:-mine:extra\\ directories\nnamed-directories:-normal:named\\ directories *'\nzstyle ':completion::complete:cd:*:named-directories-mine' \\\nfake-always mydir1 mydir2\nzstyle ':completion::complete:cd:*:named-directories-mine' \\\nignored-patterns '*'\n\nfake-files\nThis style is used when completing files and looked up without a\ntag.  Its values are of the form `dir:names...'.  This will  add\nthe names (strings separated by spaces) as possible matches when\ncompleting in the directory dir, even if no  such  files  really\nexist.   The  dir may be a pattern; pattern characters or colons\nin dir should be quoted with a backslash to  be  treated  liter-\nally.\n\nThis  can be useful on systems that support special file systems\nwhose top-level pathnames can not be listed  or  generated  with\nglob  patterns (but see accept-exact-dirs for a more general way\nof dealing with this problem).  It can also be used for directo-\nries for which one does not have read permission.\n\nThe  pattern  form can be used to add a certain `magic' entry to\nall directories on a particular file system.\n\nfake-parameters\nThis is used by the completion  function  for  parameter  names.\nIts values are names of parameters that might not yet be set but\nshould be completed nonetheless.  Each name may also be followed\nby  a  colon  and  a string specifying the type of the parameter\n(like `scalar', `array' or `integer').  If the  type  is  given,\nthe  name  will only be completed if parameters of that type are\nrequired in the particular context.  Names for which no type  is\nspecified will always be completed.\n\nfile-list\nThis  style  controls whether files completed using the standard\nbuiltin mechanism are to be listed with a long list  similar  to\nls  -l.   Note  that this feature uses the shell module zsh/stat\nfor file information; this loads the builtin stat which will re-\nplace any external stat executable.  To avoid this the following\ncode can be included in an initialization file:\n\nzmodload -i zsh/stat\ndisable stat\n\nThe style may either be set to a `true' value (or `all'), or one\nof  the  values `insert' or `list', indicating that files are to\nbe listed in long format in all circumstances, or when  attempt-\ning  to  insert  a file name, or when listing file names without\nattempting to insert one.\n\nMore generally, the value may be an array of any  of  the  above\nvalues, optionally followed by =num.  If num is present it gives\nthe maximum number of matches for which long listing style  will\nbe used.  For example,\n\nzstyle ':completion:*' file-list list=20 insert=10\n\nspecifies  that  long  format will be used when listing up to 20\nfiles or inserting a file with up  to  10  matches  (assuming  a\nlisting  is to be shown at all, for example on an ambiguous com-\npletion), else short format will be used.\n\nzstyle -e ':completion:*' file-list \\\n'(( ${+NUMERIC} )) && reply=(true)'\n\nspecifies that long format will be used any time a numeric argu-\nment is supplied, else short format.\n\nfile-patterns\nThis  is used by the standard function for completing filenames,\nfiles.  If the style is unset up to  three  tags  are  offered,\n`globbed-files',`directories'  and `all-files', depending on the\ntypes of files  expected by the caller of files.  The first two\n(`globbed-files'  and  `directories')  are  normally offered to-\ngether to make it easier to complete files in sub-directories.\n\nThe file-patterns style provides  alternatives  to  the  default\ntags, which are not used.  Its value consists of elements of the\nform `pattern:tag'; each string may contain any number  of  such\nspecifications separated by spaces.\n\nThe  pattern  is  a pattern that is to be used to generate file-\nnames.  Any occurrence of the sequence `%p' is replaced  by  any\npattern(s) passed by the function calling files.  Colons in the\npattern must be preceded by a backslash  to  make  them  distin-\nguishable  from the colon before the tag.  If more than one pat-\ntern is needed, the patterns can be given inside  braces,  sepa-\nrated by commas.\n\nThe  tags  of all strings in the value will be offered by files\nand used when looking up other styles.  Any  tags  in  the  same\nword  will  be  offered at the same time and before later words.\nIf no `:tag' is given the `files' tag will be used.\n\nThe tag may also be followed by an optional second colon  and  a\ndescription, which will be used for the `%d' in the value of the\nformat style (if that is set) instead of the default description\nsupplied  by  the completion function.  If the description given\nhere contains itself a `%d', that is replaced with the  descrip-\ntion supplied by the completion function.\n\nFor example, to make the rm command first complete only names of\nobject files and then the names of all  files  if  there  is  no\nmatching object file:\n\nzstyle ':completion:*:*:rm:*:*' file-patterns \\\n'*.o:object-files' '%p:all-files'\n\nTo alter the default behaviour of file completion -- offer files\nmatching a pattern and directories on the  first  attempt,  then\nall  files -- to offer only matching files on the first attempt,\nthen directories, and finally all files:\n\nzstyle ':completion:*' file-patterns \\\n'%p:globbed-files' '*(-/):directories' '*:all-files'\n\nThis works even  where  there  is  no  special  pattern:  files\nmatches  all  files  using the pattern `*' at the first step and\nstops when it sees this pattern.  Note also it will never try  a\npattern more than once for a single completion attempt.\n\nDuring  the execution of completion functions, the EXTENDEDGLOB\noption is in effect, so the characters `#',  `~'  and  `^'  have\nspecial meanings in the patterns.\n\nfile-sort\nThe  standard filename completion function uses this style with-\nout a tag to determine  in  which  order  the  names  should  be\nlisted;  menu completion will cycle through them in the same or-\nder.  The possible values are: `size' to sort by the size of the\nfile; `links' to sort by the number of links to the file; `modi-\nfication' (or `time' or `date') to sort by the last modification\ntime;  `access' to sort by the last access time; and `inode' (or\n`change') to sort by the last inode change time.  If  the  style\nis set to any other value, or is unset, files will be sorted al-\nphabetically by name.  If the value  contains  the  string  `re-\nverse',  sorting  is  done  in the opposite order.  If the value\ncontains the string `follow', timestamps are associated with the\ntargets  of symbolic links; the default is to use the timestamps\nof the links themselves.\n\nfile-split-chars\nA set of characters that will cause all file completions for the\ngiven  context to be split at the point where any of the charac-\nters occurs.  A typical use is to set the style to :;  then  ev-\nerything  up to and including the last : in the string so far is\nignored when completing files.  As this is  quite  heavy-handed,\nit is usually preferable to update completion functions for con-\ntexts where this behaviour is useful.\n\nfilter The ldap plugin of  email  address  completion  (see  emailad-\ndresses)  uses  this  style  to  specify the attributes to match\nagainst when filtering entries.  So for example, if the style is\nset  to  `sn', matching is done against surnames.  Standard LDAP\nfiltering is used so normal completion matching is bypassed.  If\nthis style is not set, the LDAP plugin is skipped.  You may also\nneed to set the command style to specify how to connect to  your\nLDAP server.\n\nforce-list\nThis forces a list of completions to be shown at any point where\nlisting is done, even in cases where the list would  usually  be\nsuppressed.   For  example,  normally  the list is only shown if\nthere are at least two different matches.  By setting this style\nto  `always',  the  list  will always be shown, even if there is\nonly a single match that  will  immediately  be  accepted.   The\nstyle  may  also be set to a number.  In this case the list will\nbe shown if there are at least that many matches, even  if  they\nwould all insert the same string.\n\nThis style is tested for the default tag as well as for each tag\nvalid for the current completion.   Hence  the  listing  can  be\nforced only for certain types of match.\n\nformat If  this is set for the descriptions tag, its value is used as a\nstring to display above matches in completion  lists.   The  se-\nquence  `%d'  in  this  string will be replaced with a short de-\nscription of what these matches are.  This string may also  con-\ntain  the  output  attribute  sequences understood by compadd -X\n(see zshcompwid(1)).\n\nThe style is tested with each tag valid for the current  comple-\ntion  before  it is tested for the descriptions tag.  Hence dif-\nferent format strings can be  defined  for  different  types  of\nmatch.\n\nNote  also  that  some  completer  functions  define  additional\n`%'-sequences.  These are described for the completer  functions\nthat make use of them.\n\nSome  completion  functions  display  messages  that may be cus-\ntomised by setting this style for the messages tag.   Here,  the\n`%d'  is  replaced  with a message given by the completion func-\ntion.\n\nFinally, the format string is looked up with the  warnings  tag,\nfor use when no matches could be generated at all.  In this case\nthe `%d' is replaced with the descriptions for the matches  that\nwere  expected  separated  by  spaces.  The sequence `%D' is re-\nplaced with the same descriptions separated by newlines.\n\nIt is possible to use printf-style field width  specifiers  with\n`%d' and similar escape sequences.  This is handled by the zfor-\nmat builtin command  from  the  zsh/zutil  module,  see  zshmod-\nules(1).\n\nglob   This  is  used by the expand completer.  If it is set to `true'\n(the default), globbing will be attempted on the words resulting\nfrom  a previous substitution (see the substitute style) or else\nthe original string from the line.\n\nglobal If this is set to `true' (the default), the  expandalias  com-\npleter and bindable command will try to expand global aliases.\n\ngroup-name\nThe  completion  system  can  group  different types of matches,\nwhich appear in separate lists.  This style can be used to  give\nthe  names  of groups for particular tags.  For example, in com-\nmand position the completion system generates names  of  builtin\nand external commands, names of aliases, shell functions and pa-\nrameters and reserved words as possible  completions.   To  have\nthe external commands and shell functions listed separately:\n\nzstyle ':completion:*:*:-command-:*:commands' \\\ngroup-name commands\nzstyle ':completion:*:*:-command-:*:functions' \\\ngroup-name functions\n\nAs  a consequence, any match with the same tag will be displayed\nin the same group.\n\nIf the name given is the empty string the name of  the  tag  for\nthe  matches will be used as the name of the group.  So, to have\nall different types of matches  displayed  separately,  one  can\njust set:\n\nzstyle ':completion:*' group-name ''\n\nAll  matches for which no group name is defined will be put in a\ngroup named -default-.\n\ngroup-order\nThis style is additional to the group-name style to specify  the\norder  for  display of the groups defined by that style (compare\ntag-order, which determines which completions  appear  at  all).\nThe  groups named are shown in the given order; any other groups\nare shown in the order defined by the completion function.\n\nFor example, to have names of builtin commands, shell  functions\nand  external  commands  appear in that order when completing in\ncommand position:\n\nzstyle ':completion:*:*:-command-:*:*' group-order \\\nbuiltins functions commands\n\ngroups A list of names of UNIX groups.  If this is not set, group names\nare taken from the YP database or the file `/etc/group'.\n\nhidden If this is set to `true', matches for the given context will not\nbe listed, although any description for the matches set with the\nformat style will be shown.  If it is set to `all', not even the\ndescription will be displayed.\n\nNote that the matches will still be completed; they are just not\nshown in the list.  To avoid having matches considered as possi-\nble completions at all, the tag-order style can be  modified  as\ndescribed below.\n\nhosts  A  list  of names of hosts that should be completed.  If this is\nnot set, hostnames are taken from the file `/etc/hosts'.\n\nhosts-ports\nThis style is used by commands that need or accept hostnames and\nnetwork  ports.   The strings in the value should be of the form\n`host:port'.  Valid ports are  determined  by  the  presence  of\nhostnames; multiple ports for the same host may appear.\n\nignore-line\nThis  is  tested  for each tag valid for the current completion.\nIf it is set to `true', none of the words that  are  already  on\nthe  line  will be considered as possible completions.  If it is\nset to `current', the word the cursor is on will not be  consid-\nered  as  a  possible  completion.  The value `current-shown' is\nsimilar but only applies if the list of completions is currently\nshown  on  the screen.  Finally, if the style is set to `other',\nall words on the line except for the current  one  will  be  ex-\ncluded from the possible completions.\n\nThe  values `current' and `current-shown' are a bit like the op-\nposite of the accept-exact style:   only  strings  with  missing\ncharacters will be completed.\n\nNote  that you almost certainly don't want to set this to `true'\nor `other' for a general context such as `:completion:*'.   This\nis because it would disallow completion of, for example, options\nmultiple times even if the command in question accepts  the  op-\ntion more than once.\n\nignore-parents\nThe  style  is  tested  without a tag by the function completing\npathnames in order to determine whether to ignore the  names  of\ndirectories  already  mentioned in the current word, or the name\nof the current working directory.  The value must include one or\nboth of the following strings:\n\nparent The name of any directory whose path is already contained\nin the word on the line is ignored.   For  example,  when\ncompleting  after  foo/../, the directory foo will not be\nconsidered a valid completion.\n\npwd    The name of the current working  directory  will  not  be\ncompleted;  hence, for example, completion after ../ will\nnot use the name of the current directory.\n\nIn addition, the value may include one or both of:\n\n..     Ignore the specified directories only when  the  word  on\nthe line contains the substring `../'.\n\ndirectory\nIgnore  the  specified directories only when names of di-\nrectories are completed, not  when  completing  names  of\nfiles.\n\nExcluded  values  act  in a similar fashion to values of the ig-\nnored-patterns style, so they can be restored  to  consideration\nby the ignored completer.\n\nextra-verbose\nIf  set, the completion listing is more verbose at the cost of a\nprobable decrease in completion speed.   Completion  performance\nwill suffer if this style is set to `true'.\n\nignored-patterns\nA  list  of  patterns;  any trial completion matching one of the\npatterns will be excluded from consideration.  The ignored com-\npleter  can  appear in the list of completers to restore the ig-\nnored matches.  This is a more configurable version of the shell\nparameter $fignore.\n\nNote  that  the EXTENDEDGLOB option is set during the execution\nof completion functions, so the characters `#', `~' and `^' have\nspecial meanings in the patterns.\n\ninsert This  style  is  used  by  the  allmatches completer to decide\nwhether to insert the list of all  matches  unconditionally  in-\nstead of adding the list as another match.\n\ninsert-ids\nWhen  completing  process  IDs,  for example as arguments to the\nkill and wait builtins the name of a command may be converted to\nthe  appropriate  process ID.  A problem arises when the process\nname typed is not unique.  By default (or if this style  is  set\nexplicitly  to `menu') the name will be converted immediately to\na set of possible IDs, and menu completion will  be  started  to\ncycle through them.\n\nIf the value of the style is `single', the shell will wait until\nthe user has typed enough to make the command unique before con-\nverting the name to an ID; attempts at completion will be unsuc-\ncessful until that point.  If the value  is  any  other  string,\nmenu  completion  will  be  started when the string typed by the\nuser is longer than the common prefix to the corresponding IDs.\n\ninsert-tab\nIf this is set to `true', the completion system  will  insert  a\nTAB  character  (assuming that was used to start completion) in-\nstead of performing completion when there is no non-blank  char-\nacter  to the left of the cursor.  If it is set to `false', com-\npletion will be done even there.\n\nThe value may also contain the substrings  `pending'  or  `pend-\ning=val'.   In  this  case, the typed character will be inserted\ninstead of starting completion when there is  unprocessed  input\npending.   If  a  val  is  given, completion will not be done if\nthere are at least that many characters  of  unprocessed  input.\nThis  is  often  useful when pasting characters into a terminal.\nNote however, that it relies on the $PENDING  special  parameter\nfrom  the zsh/zle module being set properly which is not guaran-\nteed on all platforms.\n\nThe default value of this style is `true' except for  completion\nwithin vared builtin command where it is `false'.\n\ninsert-unambiguous\nThis  is  used by the match and approximate completers.  These\ncompleters are often used with menu completion  since  the  word\ntyped may bear little resemblance to the final completion.  How-\never, if this style is `true', the  completer  will  start  menu\ncompletion  only  if it could find no unambiguous initial string\nat least as long as the original string typed by the user.\n\nIn the case of the approximate completer, the  completer  field\nin  the context will already have been set to one of correct-num\nor approximate-num, where num is the number of errors that  were\naccepted.\n\nIn  the  case of the match completer, the style may also be set\nto the string `pattern'.  Then the pattern on the line  is  left\nunchanged if it does not match unambiguously.\n\ngain-privileges\nIf set to true, this style enables the use of commands like sudo\nor doas to gain extra privileges when retrieving information for\ncompletion.  This  is  only done when a command such as sudo ap-\npears on the command-line. To force the use of, e.g. sudo or  to\noverride  any prefix that might be added due to gain-privileges,\nthe command style can be used with a value that  begins  with  a\nhyphen.\n\nkeep-prefix\nThis  style  is used by the expand completer.  If it is `true',\nthe completer will try to keep a prefix containing  a  tilde  or\nparameter  expansion.   Hence,  for  example,  the string `~/f*'\nwould be expanded to `~/foo' instead  of  `/home/user/foo'.   If\nthe  style  is  set  to `changed' (the default), the prefix will\nonly be left unchanged if there were other changes  between  the\nexpanded words and the original word from the command line.  Any\nother value forces the prefix to be expanded unconditionally.\n\nThe behaviour of expand when this style is `true' is  to  cause\nexpand  to  give  up  when a single expansion with the restored\nprefix is the same as the original;  hence  any  remaining  com-\npleters may be called.\n\nlast-prompt\nThis  is  a more flexible form of the ALWAYSLASTPROMPT option.\nIf it is `true', the completion system will try  to  return  the\ncursor  to  the previous command line after displaying a comple-\ntion list.  It is tested for all tags valid for the current com-\npletion, then the default tag.  The cursor will be moved back to\nthe previous line if this style  is  `true'  for  all  types  of\nmatch.   Note  that unlike the ALWAYSLASTPROMPT option this is\nindependent of the numeric argument.\n\nknown-hosts-files\nThis style should contain a list of files  to  search  for  host\nnames  and (if the use-ip style is set) IP addresses in a format\ncompatible with ssh knownhosts files.  If it is  not  set,  the\nfiles /etc/ssh/sshknownhosts and ~/.ssh/knownhosts are used.\n\nlist   This  style  is used by the historycompleteword bindable com-\nmand.  If it is set to `true' it has no effect.  If it is set to\n`false'  matches will not be listed.  This overrides the setting\nof the options  controlling  listing  behaviour,  in  particular\nAUTOLIST.   The  context  always  starts with `:completion:his-\ntory-words'.\n\nlist-colors\nIf the zsh/complist module is loaded, this style can be used  to\nset  color  specifications.   This mechanism replaces the use of\nthe ZLSCOLORS and ZLSCOLOURS parameters described in the  sec-\ntion  `The zsh/complist Module' in zshmodules(1), but the syntax\nis the same.\n\nIf this style is set for the default tag,  the  strings  in  the\nvalue  are  taken  as  specifications that are to be used every-\nwhere.  If it is set for other tags, the specifications are used\nonly  for matches of the type described by the tag.  For this to\nwork best, the group-name style must be set to an empty string.\n\nIn addition to setting styles for specific tags, it is also pos-\nsible  to use group names specified explicitly by the group-name\ntag together with the `(group)' syntax allowed by the ZLSCOLORS\nand ZLSCOLOURS parameters and simply using the default tag.\n\nIt  is  possible  to use any color specifications already set up\nfor the GNU version of the ls command:\n\nzstyle ':completion:*:default' list-colors \\\n${(s.:.)LSCOLORS}\n\nThe default colors are the same as for the GNU  ls  command  and\ncan  be  obtained  by setting the style to an empty string (i.e.\n'').\n\nlist-dirs-first\nThis is used by file completion.  If set, directories to be com-\npleted  are  listed  separately  from  and before completion for\nother files, regardless of tag ordering.  In addition,  the  tag\nother-files  is  used  in  place  of all-files for the remaining\nfiles, to indicate that no directories are presented  with  that\ntag.\n\nlist-grouped\nIf  this  style  is  `true' (the default), the completion system\nwill try to make certain completion  listings  more  compact  by\ngrouping  matches.   For example, options for commands that have\nthe same description (shown when the verbose  style  is  set  to\n`true')  will appear as a single entry.  However, menu selection\ncan be used to cycle through all the matches.\n\nlist-packed\nThis is tested for each tag valid in the current context as well\nas  the  default tag.  If it is set to `true', the corresponding\nmatches appear in listings as if  the  LISTPACKED  option  were\nset.  If it is set to `false', they are listed normally.\n\nlist-prompt\nIf  this style is set for the default tag, completion lists that\ndon't fit on the screen can be scrolled (see the description  of\nthe  zsh/complist  module  in zshmodules(1)).  The value, if not\nthe empty string, will be displayed after  every  screenful  and\nthe  shell  will  prompt for a key press; if the style is set to\nthe empty string, a default prompt will be used.\n\nThe value may contain the escape sequences: `%l' or `%L',  which\nwill  be  replaced  by the number of the last line displayed and\nthe total number of lines; `%m' or `%M', the number of the  last\nmatch  shown and the total number of matches; and `%p' and `%P',\n`Top' when at the beginning of the list, `Bottom'  when  at  the\nend  and  the position shown as a percentage of the total length\notherwise.  In each case the form with the uppercase letter will\nbe  replaced  by  a  string of fixed width, padded to the  right\nwith spaces, while the lowercase form  will  be  replaced  by  a\nvariable  width  string.  As in other prompt strings, the escape\nsequences `%S', `%s', `%B', `%b', `%U', `%u'  for  entering  and\nleaving  the  display  modes  standout,  bold and underline, and\n`%F', `%f', `%K', `%k' for changing  the  foreground  background\ncolour, are also available, as is the form `%{...%}' for enclos-\ning escape sequences which display with zero (or, with a numeric\nargument, some other) width.\n\nAfter deleting this prompt the variable LISTPROMPT should be un-\nset for the removal to take effect.\n\nlist-rows-first\nThis style is tested in the same way as  the  list-packed  style\nand  determines whether matches are to be listed in a rows-first\nfashion as if the LISTROWSFIRST option were set.\n\nlist-suffixes\nThis style is used by the function that completes filenames.  If\nit is `true', and completion is attempted on a string containing\nmultiple partially typed pathname components, all ambiguous com-\nponents will be shown.  Otherwise, completion stops at the first\nambiguous component.\n\nlist-separator\nThe value of this style is used in completion listing  to  sepa-\nrate  the  string  to  complete from a description when possible\n(e.g. when completing options).  It defaults to  `--'  (two  hy-\nphens).\n\nlocal  This  is for use with functions that complete URLs for which the\ncorresponding files are available directly from the file system.\nIts  value should consist of three strings: a hostname, the path\nto the default web pages for the server, and the directory  name\nused by a user placing web pages within their home area.\n\nFor example:\n\nzstyle ':completion:*' local toast \\\n/var/http/public/toast publichtml\n\nCompletion  after  `http://toast/stuff/'  will look for files in\nthe directory  /var/http/public/toast/stuff,   while  completion\nafter  `http://toast/~yousir/' will look for files in the direc-\ntory ~yousir/publichtml.\n\nmail-directory\nIf set, zsh will assume that mailbox files can be found  in  the\ndirectory specified.  It defaults to `~/Mail'.\n\nmatch-original\nThis  is  used  by  the match completer.  If it is set to only,\nmatch will try to generate matches without inserting a  `*'  at\nthe  cursor  position.   If set to any other non-empty value, it\nwill first try to generate matches without inserting the `*' and\nif  that  yields  no matches, it will try again with the `*' in-\nserted.  If it is unset or set to  the  empty  string,  matching\nwill only be performed with the `*' inserted.\n\nmatcher\nThis  style  is tested separately for each tag valid in the cur-\nrent context.  Its value is placed before any  match  specifica-\ntions  given  by the matcher-list style so can override them via\nthe use of an x: specification.  The value should be in the form\ndescribed  in  the section `Completion Matching Control' in zsh-\ncompwid(1).  For examples of this, see the  description  of  the\ntag-order style.\n\nFor  notes comparing the use of this and the matcher-list style,\nsee under the description of the tag-order style.\n\nmatcher-list\nThis style can be set to a list of match specifications that are\nto  be applied everywhere. Match specifications are described in\nthe section `Completion Matching Control' in zshcompwid(1).  The\ncompletion  system will try them one after another for each com-\npleter selected.  For example, to try  first  simple  completion\nand, if that generates no matches, case-insensitive completion:\n\nzstyle ':completion:*' matcher-list '' 'm:{a-zA-Z}={A-Za-z}'\n\nBy  default  each  specification replaces the previous one; how-\never, if a specification is prefixed with +, it is added to  the\nexisting list.  Hence it is possible to create increasingly gen-\neral specifications without repetition:\n\nzstyle ':completion:*' matcher-list \\\n'' '+m:{a-z}={A-Z}' '+m:{A-Z}={a-z}'\n\nIt is possible to create match specifications valid for particu-\nlar  completers  by  using the third field of the context.  This\napplies  only   to   completers   that   override   the   global\nmatcher-list, which as of this writing includes only prefix and\nignored.  For example, to  use  the  completers  complete  and\nprefix  but  allow  case-insensitive completion only with com-\nplete:\n\nzstyle ':completion:*' completer complete prefix\nzstyle ':completion:*:complete:*:*:*' matcher-list \\\n'' 'm:{a-zA-Z}={A-Za-z}'\n\nUser-defined names, as explained for the  completer  style,  are\navailable.   This  makes  it  possible to try the same completer\nmore than once with different match  specifications  each  time.\nFor example, to try normal completion without a match specifica-\ntion, then normal  completion  with  case-insensitive  matching,\nthen correction, and finally partial-word completion:\n\nzstyle ':completion:*' completer \\\ncomplete correct complete:foo\nzstyle ':completion:*:complete:*:*:*' matcher-list \\\n'' 'm:{a-zA-Z}={A-Za-z}'\nzstyle ':completion:*:foo:*:*:*' matcher-list \\\n'm:{a-zA-Z}={A-Za-z} r:|[-./]=* r:|=*'\n\nIf  the  style is unset in any context no match specification is\napplied.  Note also that some completers such  as  correct  and\napproximate  do not use the match specifications at all, though\nthese completers will only ever  be  called  once  even  if  the\nmatcher-list contains more than one element.\n\nWhere  multiple  specifications are useful, note that the entire\ncompletion is done for each element of matcher-list,  which  can\nquickly  reduce  the  shell's  performance.   As a rough rule of\nthumb, one to three strings will  give  acceptable  performance.\nOn  the other hand, putting multiple space-separated values into\nthe same string does not have an appreciable impact  on  perfor-\nmance.\n\nIf  there  is  no current matcher or it is empty, and the option\nNOCASEGLOB is in effect, the matching for files  is  performed\ncase-insensitively  in  any case.  However, any matcher must ex-\nplicitly specify case-insensitive matching if that is required.\n\nFor notes comparing the use of this and the matcher  style,  see\nunder the description of the tag-order style.\n\nmax-errors\nThis  is  used  by the approximate and correct completer func-\ntions to determine the maximum number of errors to  allow.   The\ncompleter will try to generate completions by first allowing one\nerror, then two errors, and so  on,  until  either  a  match  or\nmatches were found or the maximum number of errors given by this\nstyle has been reached.\n\nIf the value for this style contains the string  `numeric',  the\ncompleter function will take any numeric argument as the maximum\nnumber of errors allowed. For example, with\n\nzstyle ':completion:*:approximate:::' max-errors 2 numeric\n\ntwo errors are allowed if no numeric argument is given, but with\na  numeric argument of six (as in `ESC-6 TAB'), up to six errors\nare accepted.  Hence with a value of `0 numeric', no  correcting\ncompletion will be attempted unless a numeric argument is given.\n\nIf  the  value  contains the string `not-numeric', the completer\nwill not try to generate corrected completions when given a  nu-\nmeric  argument,  so  in  this  case  the number given should be\ngreater than zero.  For example, `2 not-numeric' specifies  that\ncorrecting completion with two errors will usually be performed,\nbut if a numeric argument is given, correcting  completion  will\nnot be performed.\n\nThe default value for this style is `2 numeric'.\n\nmax-matches-width\nThis  style is used to determine the trade off between the width\nof the display used for matches and the width used for their de-\nscriptions when the verbose style is in effect.  The value gives\nthe number of display columns to reserve for the  matches.   The\ndefault is half the width of the screen.\n\nThis  has the most impact when several matches have the same de-\nscription and so will be grouped together.  Increasing the style\nwill  allow  more  matches to be grouped together; decreasing it\nwill allow more of the description to be visible.\n\nmenu   If this is `true' in the context of any of the tags defined  for\nthe  current completion menu completion will be used.  The value\nfor a specific tag will take precedence over that for  the  `de-\nfault' tag.\n\nIf  none  of the values found in this way is `true' but at least\none is set to `auto', the shell behaves as if the AUTOMENU  op-\ntion is set.\n\nIf  one of the values is explicitly set to `false', menu comple-\ntion will be explicitly turned off, overriding the MENUCOMPLETE\noption and other settings.\n\nIn the form `yes=num', where `yes' may be any of the `true' val-\nues (`yes', `true', `on'  and  `1'),  menu  completion  will  be\nturned  on  if  there  are  at  least  num matches.  In the form\n`yes=long', menu completion will be turned on if the  list  does\nnot  fit  on the screen.  This does not activate menu completion\nif the widget normally only lists completions, but menu  comple-\ntion   can   be   activated   in   that   case  with  the  value\n`yes=long-list' (Typically,  the  value  `select=long-list'  de-\nscribed  later  is  more  useful  as  it  provides  control over\nscrolling.)\n\nSimilarly, with any of the `false' values (as in `no=10'),  menu\ncompletion will not be used if there are num or more matches.\n\nThe value of this widget also controls menu selection, as imple-\nmented by the zsh/complist module.  The following values may ap-\npear either alongside or instead of the values above.\n\nIf  the  value contains the string `select', menu selection will\nbe started unconditionally.\n\nIn the form `select=num', menu selection will only be started if\nthere are at least num matches.  If the values for more than one\ntag provide a number, the smallest number is taken.\n\nMenu selection can be turned off explicitly by defining a  value\ncontaining the string`no-select'.\n\nIt  is also possible to start menu selection only if the list of\nmatches does not fit on the  screen  by  using  the  value  `se-\nlect=long'.   To start menu selection even if the current widget\nonly performs listing, use the value `select=long-list'.\n\nTo turn on menu completion or menu selection when  there  are  a\ncertain number of matches or the list of matches does not fit on\nthe screen, both of `yes=' and `select='  may  be  given  twice,\nonce with a number and once with `long' or `long-list'.\n\nFinally,  it  is  possible to activate two special modes of menu\nselection.  The word `interactive' in the value causes  interac-\ntive  mode  to  be  entered  immediately  when menu selection is\nstarted; see the description of the zsh/complist module in  zsh-\nmodules(1) for a description of interactive mode.  Including the\nstring `search' does the same for incremental search  mode.   To\nselect   backward   incremental   search,   include  the  string\n`search-backward'.\n\nmuttrc If set, gives the location of the mutt configuration  file.   It\ndefaults to `~/.muttrc'.\n\nnumbers\nThis is used with the jobs tag.  If it is `true', the shell will\ncomplete job numbers instead of the shortest unambiguous  prefix\nof  the job command text.  If the value is a number, job numbers\nwill only be used if that many words from the  job  descriptions\nare  required to resolve ambiguities.  For example, if the value\nis `1', strings will only be used if  all  jobs  differ  in  the\nfirst word on their command lines.\n\nold-list\nThis  is  used  by the oldlist completer.  If it is set to `al-\nways', then standard widgets which perform listing  will  retain\nthe  current  list of matches, however they were generated; this\ncan be turned off explicitly with the value `never', giving  the\nbehaviour  without  the oldlist completer.  If the style is un-\nset, or any other value, then the existing list  of  completions\nis  displayed if it is not already; otherwise, the standard com-\npletion list is generated; this  is  the  default  behaviour  of\noldlist.   However, if there is an old list and this style con-\ntains the name of the  completer  function  that  generated  the\nlist, then the old list will be used even if it was generated by\na widget which does not do listing.\n\nFor example, suppose you type ^Xc to use the correctword  wid-\nget,  which  generates  a list of corrections for the word under\nthe cursor.  Usually, typing ^D would generate a  standard  list\nof  completions for the word on the command line, and show that.\nWith oldlist, it will instead show the list of corrections  al-\nready generated.\n\nAs  another  example consider the match completer: with the in-\nsert-unambiguous style set to `true' it inserts  only  a  common\nprefix  string, if there is any.  However, this may remove parts\nof the original pattern, so that further completion  could  pro-\nduce  more  matches  than  on  the  first attempt.  By using the\noldlist completer and setting this style to match, the list of\nmatches generated on the first attempt will be used again.\n\nold-matches\nThis  is  used by the allmatches completer to decide if an old\nlist of matches should be used if one exists.  This is  selected\nby  one  of  the  `true' values or by the string `only'.  If the\nvalue is `only', allmatches will only  use  an  old  list  and\nwon't  have  any  effect  on the list of matches currently being\ngenerated.\n\nIf this style  is  set  it  is  generally  unwise  to  call  the\nallmatches completer unconditionally.  One possible use is for\neither this style or the completer style to be defined with  the\n-e option to zstyle to make the style conditional.\n\nold-menu\nThis  is  used  by the oldlist completer.  It controls how menu\ncompletion behaves when a completion has already  been  inserted\nand  the  user types a standard completion key such as TAB.  The\ndefault behaviour of oldlist is  that  menu  completion  always\ncontinues  with the existing list of completions.  If this style\nis set to `false', however, a new completion is started  if  the\nold  list  was generated by a different completion command; this\nis the behaviour without the oldlist completer.\n\nFor example, suppose you type ^Xc to generate a list of  correc-\ntions,  and menu completion is started in one of the usual ways.\nUsually, or with this style set to `false', typing TAB  at  this\npoint would start trying to complete the line as it now appears.\nWith oldlist, it instead continues to cycle through the list of\ncorrections.\n\noriginal\nThis  is used by the approximate and correct completers to de-\ncide if the original string should be added as a  possible  com-\npletion.   Normally, this is done only if there are at least two\npossible corrections, but if this style is set to `true', it  is\nalways  added.   Note  that  the style will be examined with the\ncompleter field in the context name set to  correct-num  or  ap-\nproximate-num,  where  num is the number of errors that were ac-\ncepted.\n\npackageset\nThis style is used  when  completing  arguments  of  the  Debian\n`dpkg' program.  It contains an override for the default package\nset for a given context.  For example,\n\nzstyle ':completion:*:complete:dpkg:option--status-1:*' \\\npackageset avail\n\ncauses available packages, rather than only installed  packages,\nto be completed for `dpkg --status'.\n\npath   The function that completes color names uses this style with the\ncolors tag.  The value should be the pathname of a file contain-\ning  color  names  in the format of an X11 rgb.txt file.  If the\nstyle is not set but this file is found in one of various  stan-\ndard locations it will be used as the default.\n\npath-completion\nThis  is used by filename completion.  By default, filename com-\npletion examines all components of a path to see  if  there  are\ncompletions  of that component.  For example, /u/b/z can be com-\npleted  to  /usr/bin/zsh.   Explicitly  setting  this  style  to\n`false'  inhibits this behaviour for path components up to the /\nbefore the cursor; this  overrides  the  setting  of  accept-ex-\nact-dirs.\n\nEven with the style set to `false', it is still possible to com-\nplete multiple paths by setting the option COMPLETEINWORD  and\nmoving  the cursor back to the first component in the path to be\ncompleted.  For example, /u/b/z can be completed to /usr/bin/zsh\nif the cursor is after the /u.\n\npine-directory\nIf  set,  specifies the directory containing PINE mailbox files.\nThere is no default, since recursively searching this  directory\nis inconvenient for anyone who doesn't use PINE.\n\nports  A  list  of  Internet service names (network ports) to complete.\nIf this is not set,  service  names  are  taken  from  the  file\n`/etc/services'.\n\nprefix-hidden\nThis  is  used for certain completions which share a common pre-\nfix, for example command options beginning with dashes.   If  it\nis `true', the prefix will not be shown in the list of matches.\n\nThe default value for this style is `false'.\n\nprefix-needed\nThis  style  is  also relevant for matches with a common prefix.\nIf it is set to `true' this common prefix must be typed  by  the\nuser to generate the matches.\n\nThe  style  is  applicable  to the options, signals, jobs, func-\ntions, and parameters completion tags.\n\nFor command options, this means that the initial  `-',  `+',  or\n`--'  must  be typed explicitly before option names will be com-\npleted.\n\nFor signals, an initial `-' is required before signal names will\nbe completed.\n\nFor  jobs,  an  initial `%' is required before job names will be\ncompleted.\n\nFor function and parameter names, an initial `' or `.'  is  re-\nquired  before  function  or parameter names starting with those\ncharacters will be completed.\n\nThe default value for this style is `false' for function and pa-\nrameter completions, and  `true' otherwise.\n\npreserve-prefix\nThis style is used when completing path names.  Its value should\nbe a pattern matching an initial prefix of the word to  complete\nthat  should be left unchanged under all circumstances.  For ex-\nample, on some Unices an initial `//' (double slash) has a  spe-\ncial  meaning;  setting  this style to the string `//' will pre-\nserve it.  As another example, setting this style to `?:/' under\nCygwin would allow completion after `a:/...' and so on.\n\nrange  This  is  used  by  the history completer and the historycom-\npleteword bindable command to decide which words should be com-\npleted.\n\nIf it is a single number, only the last N words from the history\nwill be completed.\n\nIf it is a range of the form `max:slice', the last  slice  words\nwill  be  completed;  then  if that yields no matches, the slice\nwords before those will be tried and so on.  This process  stops\neither when at least one match has been found, or max words have\nbeen tried.\n\nThe default is to complete all words from the history at once.\n\nrecursive-files\nIf this style is set, its value is an array of  patterns  to  be\ntested  against  `$PWD/':  note the trailing slash, which allows\ndirectories in the pattern to be delimited unambiguously by  in-\ncluding  slashes  on both sides.  If an ordinary file completion\nfails and the word on the command line does not yet have  a  di-\nrectory  part to its name, the style is retrieved using the same\ntag as for the completion  just  attempted,  then  the  elements\ntested  against  $PWD/  in turn.  If one matches, then the shell\nreattempts completion by prepending the word on the command line\nwith  each directory in the expansion of /*(/) in turn.  Typi-\ncally the elements of the style will be set to restrict the num-\nber  of directories beneath the current one to a manageable num-\nber, for example `*/.git/*'.\n\nFor example,\n\nzstyle ':completion:*' recursive-files '*/zsh/*'\n\nIf the current directory is  /home/pws/zsh/Src,  then  zletrTAB\ncan be completed to Zle/zletricky.c.\n\nregular\nThis  style  is used by the expandalias completer and bindable\ncommand.  If set to `true' (the default), regular  aliases  will\nbe  expanded  but  only  in  command  position.  If it is set to\n`false', regular aliases will never be expanded.   If it is  set\nto  `always',  regular  aliases  will be expanded even if not in\ncommand position.\n\nrehash If this is set when completing external commands,  the  internal\nlist (hash) of commands will be updated for each search by issu-\ning the rehash command.  There is a speed penalty for this which\nis  only  likely  to  be noticeable when directories in the path\nhave slow file access.\n\nremote-access\nIf set to `false', certain commands will be prevented from  mak-\ning  Internet  connections to retrieve remote information.  This\nincludes the completion for the CVS command.\n\nIt is not always possible to know if connections are in fact  to\na remote site, so some may be prevented unnecessarily.\n\nremove-all-dups\nThe  historycompleteword  bindable  command  and the history\ncompleter use this to decide if all duplicate matches should  be\nremoved, rather than just consecutive duplicates.\n\nselect-prompt\nIf  this is set for the default tag, its value will be displayed\nduring menu selection (see the menu style above) when  the  com-\npletion  list  does  not fit on the screen as a whole.  The same\nescapes as for the list-prompt style are understood, except that\nthe  numbers  refer  to the match or line the mark is on.  A de-\nfault prompt is used when the value is the empty string.\n\nselect-scroll\nThis style is tested for the default tag and  determines  how  a\ncompletion  list  is  scrolled  during a menu selection (see the\nmenu style above) when the completion list does not fit  on  the\nscreen  as  a  whole.   If  the value is `0' (zero), the list is\nscrolled by half-screenfuls; if it is a  positive  integer,  the\nlist  is scrolled by the given number of lines; if it is a nega-\ntive number, the list is scrolled by a screenful minus the abso-\nlute  value  of  the  given  number of lines.  The default is to\nscroll by single lines.\n\nseparate-sections\nThis style is used with the manuals tag when completing names of\nmanual  pages.   If it is `true', entries for different sections\nare added separately using tag names  of  the  form  `manual.X',\nwhere  X  is  the  section number.  When the group-name style is\nalso in effect, pages from different sections will appear  sepa-\nrately.   This style is also used similarly with the words style\nwhen completing words for the dict command. It allows words from\ndifferent  dictionary databases to be added separately.  The de-\nfault for this style is `false'.\n\nshow-ambiguity\nIf the zsh/complist module is loaded, this style can be used  to\nhighlight the first ambiguous character in completion lists. The\nvalue is either a color indication such as  those  supported  by\nthe  list-colors  style or, with a value of `true', a default of\nunderlining is selected. The highlighting is only applied if the\ncompletion display strings correspond to the actual matches.\n\nshow-completer\nTested  whenever a new completer is tried.  If it is `true', the\ncompletion system outputs a progress message in the listing area\nshowing  what  completer  is  being  tried.  The message will be\noverwritten by any output when completions are found and is  re-\nmoved after completion is finished.\n\nsingle-ignored\nThis  is  used  by the ignored completer when there is only one\nmatch.  If its value is `show', the single match  will  be  dis-\nplayed  but not inserted.  If the value is `menu', then the sin-\ngle match and the original string are both added as matches  and\nmenu  completion  is started, making it easy to select either of\nthem.\n\nsort   This allows the standard ordering of matches to be overridden.\n\nIf its value is `true' or `false', sorting is  enabled  or  dis-\nabled.   Additionally the values associated with the `-o' option\nto compadd can also be listed: match, nosort, numeric,  reverse.\nIf  it is not set for the context, the standard behaviour of the\ncalling widget is used.\n\nThe style is tested first against the full context including the\ntag,  and  if  that fails to produce a value against the context\nwithout the tag.\n\nIn many cases where a calling widget explicitly selects  a  par-\nticular  ordering  in  lieu of the default, a value of `true' is\nnot honoured.  An example of where this is not the case  is  for\ncommand history where the default of sorting matches chronologi-\ncally may be overridden by setting the style to `true'.\n\nIn the expand completer, if it is set to `true', the expansions\ngenerated  will  always be sorted.  If it is set to `menu', then\nthe expansions are only sorted when they are offered  as  single\nstrings  but  not  in  the string containing all possible expan-\nsions.\n\nspecial-dirs\nNormally, the completion code will  not  produce  the  directory\nnames  `.'  and  `..' as possible completions.  If this style is\nset to `true', it will add both `.' and `..' as possible comple-\ntions; if it is set to `..', only `..' will be added.\n\nThe following example sets special-dirs to `..' when the current\nprefix is empty, is a single `.', or consists only of a path be-\nginning with `../'.  Otherwise the value is `false'.\n\nzstyle -e ':completion:*' special-dirs \\\n'[[ $PREFIX = (../)#(|.|..) ]] && reply=(..)'\n\nsqueeze-slashes\nIf  set  to  `true', sequences of slashes in filename paths (for\nexample in `foo//bar') will be treated as a single slash.   This\nis  the  usual behaviour of UNIX paths.  However, by default the\nfile completion function behaves as if there were a `*'  between\nthe slashes.\n\nstop   If  set  to  `true', the historycompleteword bindable command\nwill stop once when reaching the beginning or end  of  the  his-\ntory.   Invoking historycompleteword will then wrap around to\nthe opposite end of the  history.   If  this  style  is  set  to\n`false'  (the default), historycompleteword will loop immedi-\nately as in a menu completion.\n\nstrip-comments\nIf set to `true', this style causes non-essential  comment  text\nto  be  removed  from  completion matches.  Currently it is only\nused when completing e-mail addresses where it removes any  dis-\nplay  name  from  the  addresses,  cutting  them  down  to plain\nuser@host form.\n\nsubst-globs-only\nThis is used by the expand completer.  If it is set to  `true',\nthe  expansion  will  only be used if it resulted from globbing;\nhence, if expansions resulted from the  use  of  the  substitute\nstyle  described  below,  but  these were not further changed by\nglobbing, the expansions will be rejected.\n\nThe default for this style is `false'.\n\nsubstitute\nThis boolean style controls whether the expand  completer  will\nfirst  try  to  expand  all substitutions in the string (such as\n`$(...)' and `${...}').\n\nThe default is `true'.\n\nsuffix This is used by the expand completer if the word starts with  a\ntilde  or  contains  a  parameter  expansion.   If  it is set to\n`true', the word will only be expanded if it doesn't have a suf-\nfix,  i.e.  if it is something like `~foo' or `$foo' rather than\n`~foo/' or `$foo/bar', unless that suffix itself contains  char-\nacters  eligible  for  expansion.  The default for this style is\n`true'.\n\ntag-order\nThis provides a mechanism for sorting how the tags available  in\na particular context will be used.\n\nThe  values  for  the style are sets of space-separated lists of\ntags.  The tags in each value will be tried at the same time; if\nno  match  is found, the next value is used.  (See the file-pat-\nterns style for an exception to this behavior.)\n\nFor example:\n\nzstyle ':completion:*:complete:-command-:*:*' tag-order \\\n'commands functions'\n\nspecifies that completion in command position first  offers  ex-\nternal  commands  and  shell  functions.  Remaining tags will be\ntried if no completions are found.\n\nIn addition to tag names, each string in the value may take  one\nof the following forms:\n\n-      If  any  value  consists  of only a hyphen, then only the\ntags specified in the other values are  generated.   Nor-\nmally  all tags not explicitly selected are tried last if\nthe specified tags fail to generate  any  matches.   This\nmeans that a single value consisting only of a single hy-\nphen turns off completion.\n\n! tags...\nA string starting  with  an  exclamation  mark  specifies\nnames of tags that are not to be used.  The effect is the\nsame as if all other possible tags for  the  context  had\nbeen listed.\n\ntag:label ...\nHere, tag is one of the standard tags and label is an ar-\nbitrary name.  Matches are generated as  normal  but  the\nname  label  is used in contexts instead of tag.  This is\nnot useful in words starting with !.\n\nIf the label starts with a hyphen, the tag  is  prepended\nto  the label to form the name used for lookup.  This can\nbe used to make the completion system try a  certain  tag\nmore  than  once,  supplying different style settings for\neach attempt; see below for an example.\n\ntag:label:description\nAs before, but description will replace the `%d'  in  the\nvalue of the format style instead of the default descrip-\ntion supplied by the completion function.  Spaces in  the\ndescription  must be quoted with a backslash.  A `%d' ap-\npearing in description is replaced with  the  description\ngiven by the completion function.\n\nIn  any  of  the forms above the tag may be a pattern or several\npatterns in the form `{pat1,pat2...}'.  In this case all  match-\ning  tags  will  be  used except for any given explicitly in the\nsame string.\n\nOne use of these features is to try one tag more than once, set-\nting  other styles differently on each attempt, but still to use\nall the other tags without having to repeat them all.  For exam-\nple,  to  make  completion of function names in command position\nignore all the completion functions starting with an  underscore\nthe first time completion is tried:\n\nzstyle ':completion:*:*:-command-:*:*' tag-order \\\n'functions:-non-comp *' functions\nzstyle ':completion:*:functions-non-comp' \\\nignored-patterns '*'\n\nOn the first attempt, all tags will be offered but the functions\ntag will be replaced by  functions-non-comp.   The  ignored-pat-\nterns  style  is  set for this tag to exclude functions starting\nwith an underscore.  If there are no matches, the  second  value\nof  the  tag-order style is used which completes functions using\nthe default tag, this time  presumably  including  all  function\nnames.\n\nThe matches for one tag can be split into different groups.  For\nexample:\n\nzstyle ':completion:*' tag-order \\\n'options:-long:long\\ options\noptions:-short:short\\ options\noptions:-single-letter:single\\ letter\\ options'\nzstyle ':completion:*:options-long' \\\nignored-patterns '[-+](|-|[^-]*)'\nzstyle ':completion:*:options-short' \\\nignored-patterns '--*' '[-+]?'\nzstyle ':completion:*:options-single-letter' \\\nignored-patterns '???*'\n\nWith the group-names style set, options beginning with `--', op-\ntions beginning with a single `-' or `+' but containing multiple\ncharacters, and single-letter options will be displayed in sepa-\nrate groups with different descriptions.\n\nAnother  use of patterns is to try multiple match specifications\none after another.  The matcher-list style offers something sim-\nilar,  but  it is tested very early in the completion system and\nhence can't be set for single commands  nor  for  more  specific\ncontexts.   Here  is  how  to  try normal completion without any\nmatch specification and, if that generates no matches, try again\nwith  case-insensitive matching, restricting the effect to argu-\nments of the command foo:\n\nzstyle ':completion:*:*:foo:*:*' tag-order '*' '*:-case'\nzstyle ':completion:*-case' matcher 'm:{a-z}={A-Z}'\n\nFirst, all the tags offered when completing after foo are  tried\nusing  the  normal  tag name.  If that generates no matches, the\nsecond value of tag-order is used, which tries  all  tags  again\nexcept  that  this  time each has -case appended to its name for\nlookup of styles.  Hence this time the  value  for  the  matcher\nstyle  from  the second call to zstyle in the example is used to\nmake completion case-insensitive.\n\nIt is possible to use the -e option of the zstyle  builtin  com-\nmand  to specify conditions for the use of particular tags.  For\nexample:\n\nzstyle -e '*:-command-:*' tag-order '\nif [[ -n $PREFIX$SUFFIX ]]; then\nreply=( )\nelse\nreply=( - )\nfi'\n\nCompletion in command position will be  attempted  only  if  the\nstring typed so far is not empty.  This is tested using the PRE-\nFIX special parameter; see zshcompwid for a description  of  pa-\nrameters  which  are special inside completion widgets.  Setting\nreply to an empty array provides the default behaviour of trying\nall  tags  at once; setting it to an array containing only a hy-\nphen disables the use of all tags and hence of all completions.\n\nIf no tag-order style  has  been  defined  for  a  context,  the\nstrings  `(|*-)argument-*  (|*-)option-*  values'  and `options'\nplus all tags offered by the completion function will be used to\nprovide  a  sensible  default  behavior  that  causes  arguments\n(whether normal command arguments or arguments of options) to be\ncompleted before option names for most commands.\n\nurls   This  is used together with the urls tag by functions completing\nURLs.\n\nIf the value consists of more than one string, or  if  the  only\nstring  does  not name a file or directory, the strings are used\nas the URLs to complete.\n\nIf the value contains only one string which is  the  name  of  a\nnormal  file  the  URLs are taken from that file (where the URLs\nmay be separated by white space or newlines).\n\nFinally, if the only string in the value names a directory,  the\ndirectory  hierarchy  rooted at this directory gives the comple-\ntions.  The top  level  directory  should  be  the  file  access\nmethod,  such  as  `http', `ftp', `bookmark' and so on.  In many\ncases the next level of directories will be a filename.  The di-\nrectory hierarchy can descend as deep as necessary.\n\nFor example,\n\nzstyle ':completion:*' urls ~/.urls\nmkdir -p ~/.urls/ftp/ftp.zsh.org/pub\n\nallows   completion   of   all   the   components   of  the  URL\nftp://ftp.zsh.org/pub after suitable commands such as `netscape'\nor  `lynx'.   Note,  however,  that access methods and files are\ncompleted separately, so if the hosts style is set hosts can  be\ncompleted without reference to the urls style.\n\nSee the description in the function urls itself for more infor-\nmation (e.g. `more $^fpath/urls(N)').\n\nuse-cache\nIf this is set, the completion caching layer  is  activated  for\nany  completions  which  use  it  (via  the  storecache,  re-\ntrievecache, and cacheinvalid functions).  The directory con-\ntaining  the  cache  files  can  be  changed with the cache-path\nstyle.\n\nuse-compctl\nIf this style is set to a string not equal to false, 0, no,  and\noff, the completion system may use any completion specifications\ndefined with the compctl builtin command.  If the style  is  un-\nset, this is done only if the zsh/compctl module is loaded.  The\nstring may also contain the substring `first' to use completions\ndefined  with  `compctl  -T', and the substring `default' to use\nthe completion defined with `compctl -D'.\n\nNote that this is only intended to smooth  the  transition  from\ncompctl  to  the  new completion system and may disappear in the\nfuture.\n\nNote also that the definitions from compctl will only be used if\nthere  is  no  specific  completion  function for the command in\nquestion.  For example, if there is a function foo to  complete\narguments  to the command foo, compctl will never be invoked for\nfoo.  However, the compctl version will be  tried  if  foo  only\nuses default completion.\n\nuse-ip By default, the function hosts that completes host names strips\nIP addresses from entries read from host databases such  as  NIS\nand  ssh  files.   If this style is `true', the corresponding IP\naddresses can be completed as well.  This style is  not  use  in\nany  context  where the hosts style is set; note also it must be\nset before the cache of host names is generated  (typically  the\nfirst completion attempt).\n\nusers  This  may  be set to a list of usernames to be completed.  If it\nis not set all usernames will be completed.  Note that if it  is\nset  only  that list of users will be completed; this is because\non some systems querying all users can take a prohibitive amount\nof time.\n\nusers-hosts\nThe  values  of  this style should be of the form `user@host' or\n`user:host'. It is used for commands that need  pairs  of  user-\nand hostnames.  These commands will complete usernames from this\nstyle (only), and will restrict subsequent  hostname  completion\nto  hosts  paired  with  that  user  in one of the values of the\nstyle.\n\nIt is possible to group values for sets of commands which  allow\na remote login, such as rlogin and ssh, by using the my-accounts\ntag.  Similarly, values for sets of commands which usually refer\nto the accounts of other people, such as talk and finger, can be\ngrouped by using the other-accounts tag.  More  ambivalent  com-\nmands may use the accounts tag.\n\nusers-hosts-ports\nLike  users-hosts but used for commands like telnet and contain-\ning strings of the form `user@host:port'.\n\nverbose\nIf set, as it is by default, the completion listing is more ver-\nbose.  In particular many commands show descriptions for options\nif this style is `true'.\n\nword   This is used by the list completer, which prevents  the  inser-\ntion  of  completions until a second completion attempt when the\nline has not changed.  The normal way of finding out if the line\nhas  changed  is  to compare its entire contents between the two\noccasions.  If this style is `true', the comparison  is  instead\nperformed only on the current word.  Hence if completion is per-\nformed on another word with the same contents,  completion  will\nnot be delayed.\n",
            "subsections": []
        },
        "CONTROL FUNCTIONS": {
            "content": "The initialization script compinit redefines all the widgets which per-\nform completion to call the supplied  widget  function  maincomplete.\nThis function acts as a wrapper calling the so-called `completer' func-\ntions that generate matches.  If maincomplete is  called  with  argu-\nments, these are taken as the names of completer functions to be called\nin the order given.  If no arguments are given, the set of functions to\ntry is taken from the completer style.  For example, to use normal com-\npletion and correction if that doesn't generate any matches:\n\nzstyle ':completion:*' completer complete correct\n\nafter calling compinit. The default value for this style is  `complete\nignored',  i.e. normally only ordinary completion is tried, first with\nthe effect of the ignored-patterns style  and  then  without  it.   The\nmaincomplete  function  uses the return status of the completer func-\ntions to decide if other completers should be called.   If  the  return\nstatus  is  zero,  no other completers are tried and the maincomplete\nfunction returns.\n\nIf the first argument to maincomplete is a single hyphen,  the  argu-\nments  will  not  be taken as names of completers.  Instead, the second\nargument gives a name to use in the completer field of the context  and\nthe other arguments give a command name and arguments to call to gener-\nate the matches.\n\nThe following completer functions are contained  in  the  distribution,\nalthough  users may write their own.  Note that in contexts the leading\nunderscore is stripped, for example basic completion  is  performed  in\nthe context `:completion::complete:...'.\n\nallmatches\nThis  completer  can  be  used to add a string consisting of all\nother matches.  As it influences later completers it must appear\nas  the first completer in the list.  The list of all matches is\naffected by the avoid-completer and old-matches styles described\nabove.\n\nIt may be useful to use the generic function described below to\nbind allmatches to its own keystroke, for example:\n\nzle -C all-matches complete-word generic\nbindkey '^Xa' all-matches\nzstyle ':completion:all-matches:*' old-matches only\nzstyle ':completion:all-matches::::' completer allmatches\n\nNote that this does not generate completions by  itself:   first\nuse  any  of  the  standard ways of generating a list of comple-\ntions, then use ^Xa to show all matches.  It is possible instead\nto  add  a  standard  completer to the list and request that the\nlist of all matches should be directly inserted:\n\nzstyle ':completion:all-matches::::' completer \\\nallmatches complete\nzstyle ':completion:all-matches:*' insert true\n\nIn this case the old-matches style should not be set.\n\napproximate\nThis is similar to the basic complete completer but allows  the\ncompletions  to  undergo corrections.  The maximum number of er-\nrors can be specified by the max-errors style; see the  descrip-\ntion  of  approximate  matching in zshexpn(1) for how errors are\ncounted.  Normally this completer will only be tried  after  the\nnormal complete completer:\n\nzstyle ':completion:*' completer complete approximate\n\nThis  will give correcting completion if and only if normal com-\npletion yields no possible completions.  When corrected  comple-\ntions  are found, the completer will normally start menu comple-\ntion allowing you to cycle through these strings.\n\nThis completer uses the tags corrections and original when  gen-\nerating  the  possible corrections and the original string.  The\nformat style for the former may contain the additional sequences\n`%e' and `%o' which will be replaced by the number of errors ac-\ncepted to generate the corrections and the original string,  re-\nspectively.\n\nThe  completer  progressively increases the number of errors al-\nlowed up to the limit by the max-errors style, hence if  a  com-\npletion  is found with one error, no completions with two errors\nwill be shown, and so on.  It modifies the completer name in the\ncontext  to  indicate  the  number of errors being tried: on the\nfirst try the completer field contains `approximate-1',  on  the\nsecond try `approximate-2', and so on.\n\nWhen approximate is called from another function, the number of\nerrors to accept may be passed with the -a option.  The argument\nis  in  the  same  format  as  the  max-errors style, all in one\nstring.\n\nNote that this completer (and the correct  completer  mentioned\nbelow)  can  be quite expensive to call, especially when a large\nnumber of errors are allowed.  One way to avoid this is  to  set\nup  the  completer  style  using the -e option to zstyle so that\nsome completers are only used when  completion  is  attempted  a\nsecond time on the same string, e.g.:\n\nzstyle -e ':completion:*' completer '\nif [[ $lasttry != \"$HISTNO$BUFFER$CURSOR\" ]]; then\nlasttry=\"$HISTNO$BUFFER$CURSOR\"\nreply=(complete match prefix)\nelse\nreply=(ignored correct approximate)\nfi'\n\nThis uses the HISTNO parameter and the BUFFER and CURSOR special\nparameters that are available inside zle and completion  widgets\nto  find  out  if the command line hasn't changed since the last\ntime completion was tried.  Only then are the ignored, correct\nand approximate completers called.\n\ncanonicalpaths  [ -A var ] [ -N ] [ -MJV12nfX ] tag descr [ paths ...\n]\nThis completion function completes all paths given  to  it,  and\nalso  tries to offer completions which point to the same file as\none of the paths given (relative path when an absolute  path  is\ngiven,  and  vice versa; when ..'s are present in the word to be\ncompleted; and some paths got from symlinks).\n\n-A, if specified, takes the paths from the array variable speci-\nfied.  Paths  can also be specified on the command line as shown\nabove.  -N, if  specified,  prevents  canonicalizing  the  paths\ngiven before using them for completion, in case they are already\nso. The options -M, -J, -V, -1, -2, -n, -F,  -X  are  passed  to\ncompadd.\n\nSee description for a description of tag and descr.\n\ncmdambivalent\nCompletes the remaining positional arguments as an external com-\nmand.  The external command and its arguments are  completed  as\nseparate  arguments  (in  a  manner  appropriate  for completing\n/usr/bin/env) if there are two or more remaining positional  ar-\nguments  on the command line, and as a quoted command string (in\nthe manner of system(...)) otherwise.  See also  cmdstring  and\nprecommand.\n\nThis function takes no arguments.\n\ncmdstring\nCompletes  an external command as a single argument, as for sys-\ntem(...).\n\ncomplete\nThis completer generates all  possible  completions  in  a  con-\ntext-sensitive  manner, i.e. using the settings defined with the\ncompdef function explained above and the current settings of all\nspecial parameters.  This gives the normal completion behaviour.\n\nTo  complete  arguments  of commands, complete uses the utility\nfunction normal, which is in turn responsible for  finding  the\nparticular function; it is described below.  Various contexts of\nthe form -context- are handled specifically. These are all  men-\ntioned above as possible arguments to the #compdef tag.\n\nBefore  trying  to find a function for a specific context, com-\nplete checks if the  parameter  `compcontext'  is  set.  Setting\n`compcontext'  allows  the  usual  completion  dispatching to be\noverridden which is useful in places such  as  a  function  that\nuses vared for input. If it is set to an array, the elements are\ntaken to be the possible matches which will be  completed  using\nthe tag `values' and the description `value'. If it is set to an\nassociative array, the keys are used as the possible completions\nand  the  values (if non-empty) are used as descriptions for the\nmatches.  If `compcontext' is set to a string containing colons,\nit  should  be of the form `tag:descr:action'.  In this case the\ntag and descr give the tag and description to use and the action\nindicates  what should be completed in one of the forms accepted\nby the arguments utility function described below.\n\nFinally, if `compcontext' is set to a string without colons, the\nvalue  is  taken as the name of the context to use and the func-\ntion defined for that context will be called.  For this purpose,\nthere  is  a special context named -command-line- that completes\nwhole command lines (commands and their arguments).  This is not\nused  by the completion system itself but is nonetheless handled\nwhen explicitly called.\n\ncorrect\nGenerate corrections, but not completions, for the current word;\nthis is similar to approximate but will not allow any number of\nextra characters at the cursor as that completer does.  The  ef-\nfect is similar to spell-checking.  It is based on approximate,\nbut the completer field in the context name is correct.\n\nFor example, with:\n\nzstyle ':completion:::::' completer \\\ncomplete correct approximate\nzstyle ':completion:*:correct:::' max-errors 2 not-numeric\nzstyle ':completion:*:approximate:::' max-errors 3 numeric\n\ncorrection will accept up to two errors.  If a numeric  argument\nis  given, correction will not be performed, but correcting com-\npletion will be, and will accept as many errors as given by  the\nnumeric  argument.  Without a numeric argument, first correction\nand then correcting completion will be tried, with the first one\naccepting two errors and the second one accepting three errors.\n\nWhen  correct  is called as a function, the number of errors to\naccept may be given following the -a option.  The argument is in\nthe same form a values to the accept style, all in one string.\n\nThis  completer function is intended to be used without the ap-\nproximate completer or, as in the example, just before it.   Us-\ning  it  after  the approximate completer is useless since ap-\nproximate will at least generate the corrected strings generated\nby the correct completer -- and probably more.\n\nexpand\nThis  completer function does not really perform completion, but\ninstead checks if the word on the command line is  eligible  for\nexpansion  and,  if  it is, gives detailed control over how this\nexpansion is done.  For this to happen,  the  completion  system\nneeds  to  be invoked with complete-word, not expand-or-complete\n(the default binding for TAB), as otherwise the string  will  be\nexpanded by the shell's internal mechanism before the completion\nsystem is started.  Note also this completer  should  be  called\nbefore the complete completer function.\n\nThe  tags used when generating expansions are all-expansions for\nthe string containing all possible expansions,  expansions  when\nadding  the  possible  expansions as single matches and original\nwhen adding the original string from the  line.   The  order  in\nwhich  these strings are generated, if at all, can be controlled\nby the group-order and tag-order styles, as usual.\n\nThe format string for all-expansions and for expansions may con-\ntain  the  sequence  `%o' which will be replaced by the original\nstring from the line.\n\nThe kind of expansion to be tried is controlled by  the  substi-\ntute, glob and subst-globs-only styles.\n\nIt is also possible to call expand as a function, in which case\nthe different modes may be selected with options: -s for substi-\ntute, -g for glob and -o for subst-globs-only.\n\nexpandalias\nIf  the word the cursor is on is an alias, it is expanded and no\nother completers are called.  The types of aliases which are  to\nbe  expanded  can  be controlled with the styles regular, global\nand disabled.\n\nThis function is also a bindable command, see the section `Bind-\nable Commands' below.\n\nextensions\nIf  the  cursor follows the string `*.', filename extensions are\ncompleted. The extensions are taken from files in current direc-\ntory  or  a  directory specified at the beginning of the current\nword. For exact matches, completion  continues  to  allow  other\ncompleters  such  as expand to expand the pattern. The standard\nadd-space and prefix-hidden styles are observed.\n\nexternalpwds\nCompletes current directories of other zsh  processes  belonging\nto the current user.\n\nThis  is intended to be used via generic, bound to a custom key\ncombination. Note that pattern matching is enabled  so  matching\nis performed similar to how it works with the match completer.\n\nhistory\nComplete  words  from  the  shell's command  history.  This com-\npleter can be controlled by the remove-all-dups, and sort styles\nas for the historycompleteword bindable command, see the sec-\ntion `Bindable Commands' below and the section `Completion  Sys-\ntem Configuration' above.\n\nignored\nThe  ignored-patterns  style  can  be  set to a list of patterns\nwhich are compared against possible completions;  matching  ones\nare  removed.   With  this  completer those matches can be rein-\nstated, as if no ignored-patterns style were set.  The completer\nactually generates its own list of matches; which completers are\ninvoked is determined in the same way as for  the  prefix  com-\npleter.  The single-ignored style is also available as described\nabove.\n\nlist  This completer allows the insertion of matches to be delayed un-\ntil  completion  is  attempted a second time without the word on\nthe line being changed.  On the first attempt, only the list  of\nmatches  will  be shown.  It is affected by the styles condition\nand word, see  the  section  `Completion  System  Configuration'\nabove.\n\nmatch This  completer  is intended to be used after the complete com-\npleter.  It behaves similarly but the string on the command line\nmay be a pattern to match against trial completions.  This gives\nthe effect of the GLOBCOMPLETE option.\n\nNormally completion will be performed by taking the pattern from\nthe  line,  inserting a `*' at the cursor position and comparing\nthe resulting pattern with the possible  completions  generated.\nThis  can  be  modified  with the match-original style described\nabove.\n\nThe generated matches will be offered in a menu  completion  un-\nless  the insert-unambiguous style is set to `true'; see the de-\nscription above for other options for this style.\n\nNote that matcher specifications defined globally or used by the\ncompletion  functions (the styles matcher-list and matcher) will\nnot be used.\n\nmenu  This completer was written as simple example  function  to  show\nhow  menu  completion  can be enabled in shell code. However, it\nhas the notable effect of disabling menu selection which can  be\nuseful  with  generic  based  widgets. It should be used as the\nfirst completer in the list.  Note that this is  independent  of\nthe  setting  of the MENUCOMPLETE option and does not work with\nthe other menu completion widgets such as reverse-menu-complete,\nor accept-and-menu-complete.\n\noldlist\nThis  completer controls how the standard completion widgets be-\nhave when there is an existing list  of  completions  which  may\nhave  been  generated  by  a  special  completion  (i.e. a sepa-\nrately-bound completion command).  It allows the  ordinary  com-\npletion  keys  to  continue  to use the list of completions thus\ngenerated, instead of producing a new list of  ordinary  contex-\ntual  completions.   It  should appear in the list of completers\nbefore any of the widgets which generate matches.  It  uses  two\nstyles:  old-list and old-menu, see the section `Completion Sys-\ntem Configuration' above.\n\nprecommand\nComplete an external command in word-separated arguments, as for\nexec and /usr/bin/env.\n\nprefix\nThis  completer  can  be  used to try completion with the suffix\n(everything after the cursor) ignored.  In other words, the suf-\nfix  will  not be considered to be part of the word to complete.\nThe effect is similar to the expand-or-complete-prefix command.\n\nThe completer style is used to decide which other completers are\nto  be  called to generate matches.  If this style is unset, the\nlist of completers set for the current context is  used  --  ex-\ncept,  of course, the prefix completer itself.  Furthermore, if\nthis completer appears more than once in the list of  completers\nonly  those  completers not already tried by the last invocation\nof prefix will be called.\n\nFor example, consider this global completer style:\n\nzstyle ':completion:*' completer \\\ncomplete prefix correct prefix:foo\n\nHere, the prefix completer tries normal completion but ignoring\nthe  suffix.   If that doesn't generate any matches, and neither\ndoes the call to the correct completer after it,  prefix  will\nbe called a second time and, now only trying correction with the\nsuffix ignored.  On the second invocation the completer part  of\nthe context appears as `foo'.\n\nTo use prefix as the last resort and try only normal completion\nwhen it is invoked:\n\nzstyle ':completion:*' completer complete ... prefix\nzstyle ':completion::prefix:*' completer complete\n\nThe add-space style is also respected.  If it is set  to  `true'\nthen  prefix  will insert a space between the matches generated\n(if any) and the suffix.\n\nNote that this completer is only useful if the  COMPLETEINWORD\noption is set; otherwise, the cursor will be moved to the end of\nthe current word before the completion code is called and  hence\nthere will be no suffix.\n\nuserexpand\nThis  completer  behaves  similarly to the expand completer but\ninstead  performs  expansions  defined  by  users.   The  styles\nadd-space  and sort styles specific to the expand completer are\nusable with userexpand in addition  to  other  styles  handled\nmore generally by the completion system.  The tag all-expansions\nis also available.\n\nThe expansion depends on the array style user-expand  being  de-\nfined  for  the  current  context; remember that the context for\ncompleters is less specific than that for contextual  completion\nas  the  full  context has not yet been determined.  Elements of\nthe array may have one of the following forms:\n\n$hash\n\nhash is the name of an associative array.  Note  this  is\nnot  a  full  parameter  expression, merely a $, suitably\nquoted to prevent immediate expansion,  followed  by  the\nname  of  an  associative  array.  If the trial expansion\nword matches a key in hash, the  resulting  expansion  is\nthe corresponding value.\nfunc\n\nfunc is the name of a shell function whose name must be-\ngin with  but is not otherwise special to the completion\nsystem.  The function is called with the trial word as an\nargument.  If the word is to be  expanded,  the  function\nshould  set the array reply to a list of expansions.  Op-\ntionally, it can set REPLY to a word that will be used as\na description for the set of expansions.  The return sta-\ntus of the function is irrelevant.",
            "subsections": []
        },
        "BINDABLE COMMANDS": {
            "content": "In addition to the context-dependent completions  provided,  which  are\nexpected to work in an intuitively obvious way, there are a few widgets\nimplementing special behaviour which can be bound separately  to  keys.\nThe following is a list of these and their default bindings.\n\nbashcompletions\nThis  function  is  used by two widgets, bashcomplete-word and\nbashlist-choices.  It exists  to  provide  compatibility  with\ncompletion  bindings in bash.  The last character of the binding\ndetermines what is completed: `!', command names; `$',  environ-\nment  variables;  `@',  host  names;  `/',  file names; `~' user\nnames.  In bash, the binding preceded by `\\e' gives  completion,\nand  preceded  by `^X' lists options.  As some of these bindings\nclash with standard zsh bindings, only `\\e~' and `^X~' are bound\nby  default.   To add the rest, the following should be added to\n.zshrc after compinit has been run:\n\nfor key in '!' '$' '@' '/' '~'; do\nbindkey \"\\e$key\" bashcomplete-word\nbindkey \"^X$key\" bashlist-choices\ndone\n\nThis includes the bindings for `~' in  case  they  were  already\nbound  to  something else; the completion code does not override\nuser bindings.\n\ncorrectfilename (^XC)\nCorrect the filename path at the cursor position.  Allows up  to\nsix  errors in the name.  Can also be called with an argument to\ncorrect a filename path, independently of zle; the correction is\nprinted on standard output.\n\ncorrectword (^Xc)\nPerforms correction of the current argument using the usual con-\ntextual completions as possible choices. This stores the  string\n`correct-word'  in  the  function  field of the context name and\nthen calls the correct completer.\n\nexpandalias (^Xa)\nThis function can be used as a completer and as a bindable  com-\nmand.   It  expands the word the cursor is on if it is an alias.\nThe types of alias expanded can be controlled  with  the  styles\nregular, global and disabled.\n\nWhen  used as a bindable command there is one additional feature\nthat can be selected by setting the complete  style  to  `true'.\nIn  this  case,  if  the  word is not the name of an alias, ex-\npandalias tries to complete the word to a full alias name with-\nout  expanding it.  It leaves the cursor directly after the com-\npleted word so that invoking expandalias once more will expand\nthe now-complete alias name.\n\nexpandword (^Xe)\nPerforms expansion on the current word:  equivalent to the stan-\ndard expand-word command, but using the expand completer.   Be-\nfore  calling  it,  the  function field of the context is set to\n`expand-word'.\n\ngeneric\nThis function is not defined as a widget and not  bound  by  de-\nfault.  However, it can be used to define a widget and will then\nstore the name of the widget in the function field of  the  con-\ntext and call the completion system.  This allows custom comple-\ntion widgets with their own set of style settings to be  defined\neasily.   For  example,  to define a widget that performs normal\ncompletion and starts menu selection:\n\nzle -C foo complete-word generic\nbindkey '...' foo\nzstyle ':completion:foo:*' menu yes select=1\n\nNote in particular that the completer style may be set  for  the\ncontext in order to change the set of functions used to generate\npossible matches.  If generic is called with  arguments,  those\nare  passed  through to maincomplete as the list of completers\nin place of those defined by the completer style.\n\nhistorycompleteword (\\e/)\nComplete words from the shell's command history. This  uses  the\nlist, remove-all-dups, sort, and stop styles.\n\nmostrecentfile (^Xm)\nComplete  the  name  of the most recently modified file matching\nthe pattern on the command line (which may be blank).  If  given\na  numeric  argument  N, complete the Nth most recently modified\nfile.  Note the completion, if any, is always unique.\n\nnexttags (^Xn)\nThis command alters the set of matches used to that for the next\ntag,  or  set of tags, either as given by the tag-order style or\nas set by default; these matches would otherwise not  be  avail-\nable.   Successive  invocations of the command cycle through all\npossible sets of tags.\n\nreadcomp (^X^R)\nPrompt the user for a string, and use that to perform completion\non  the  current  word.   There  are  two  possibilities for the\nstring.  First, it can be a set of words beginning `', for  ex-\nample `files -/', in which case the function with any arguments\nwill be called to generate the completions.   Unambiguous  parts\nof  the  function  name  will be completed automatically (normal\ncompletion is not available at this  point)  until  a  space  is\ntyped.\n\nSecond, any other string will be passed as a set of arguments to\ncompadd and should hence be an expression specifying what should\nbe completed.\n\nA  very  restricted  set  of  editing commands is available when\nreading the string:  `DEL' and `^H' delete the  last  character;\n`^U'  deletes  the  line,  and `^C' and `^G' abort the function,\nwhile `RET' accepts the completion.  Note  the  string  is  used\nverbatim  as  a command line, so arguments must be quoted in ac-\ncordance with standard shell rules.\n\nOnce a string has been read, the next call  to  readcomp  will\nuse  the existing string instead of reading a new one.  To force\na new string to be read, call readcomp with  a  numeric  argu-\nment.\n\ncompletedebug (^X?)\nThis widget performs ordinary completion, but captures in a tem-\nporary file a trace of the shell commands executed by  the  com-\npletion  system.   Each completion attempt gets its own file.  A\ncommand to view each of these files is pushed  onto  the  editor\nbuffer stack.\n\ncompletehelp (^Xh)\nThis  widget  displays  information about the context names, the\ntags, and the completion functions used when completing  at  the\ncurrent  cursor position. If given a numeric argument other than\n1 (as in `ESC-2 ^Xh'), then the styles used and the contexts for\nwhich they are used will be shown, too.\n\nNote that the information about styles may be incomplete; it de-\npends on the information available from the completion functions\ncalled, which in turn is determined by the user's own styles and\nother settings.\n\ncompletehelpgeneric\nUnlike other commands listed here, this must  be  created  as  a\nnormal ZLE widget rather than a completion widget (i.e. with zle\n-N).  It is used for generating help with a widget bound to  the\ngeneric widget that is described above.\n\nIf  this widget is created using the name of the function, as it\nis by default, then when executed it will read a  key  sequence.\nThis  is expected to be bound to a call to a completion function\nthat uses the generic widget.  That widget  will  be  executed,\nand  information  provided  in  the  same  format that the com-\npletehelp widget displays for contextual completion.\n\nIf the widget's name contains debug, for example if it  is  cre-\nated as `zle -N completedebuggeneric completehelpgeneric',\nit will read and execute the keystring for a generic  widget  as\nbefore, but then generate debugging information as done by com-\npletedebug for contextual completion.\n\nIf the widget's  name  contains  noread,  it  will  not  read  a\nkeystring  but  instead  arrange  that the next use of a generic\nwidget run in the same shell will have the effect  as  described\nabove.\n\nThe    widget    works    by   setting   the   shell   parameter\nZSHTRACEGENERICWIDGET which is read by  generic.   Unsetting\nthe parameter cancels any pending effect of the noread form.\n\nFor example, after executing the following:\n\nzle -N completedebuggeneric completehelpgeneric\nbindkey '^x:' completedebuggeneric\n\ntyping `C-x :' followed by the key sequence for a generic widget\nwill cause trace output for that widget to be saved to a file.\n\ncompletetag (^Xt)\nThis widget completes symbol tags created by the etags or  ctags\nprogrammes (note there is no connection with the completion sys-\ntem's tags) stored in a file TAGS, in the format used by  etags,\nor  tags,  in the format created by ctags.  It will look back up\nthe path hierarchy for the first occurrence of either  file;  if\nboth  exist,  the  file  TAGS is preferred.  You can specify the\nfull path to a TAGS or tags file by setting the parameter $TAGS-\nFILE  or  $tagsfile  respectively.  The corresponding completion\ntags used are etags and vtags, after emacs and vi respectively.\n",
            "subsections": []
        },
        "UTILITY FUNCTIONS": {
            "content": "Descriptions follow for utility functions that may be useful when writ-\ning  completion  functions.   If functions are installed in subdirecto-\nries, most of these reside in the Base subdirectory.  Like the  example\nfunctions  for commands in the distribution, the utility functions gen-\nerating matches all follow the convention of returning status  zero  if\nthey  generated  completions  and  non-zero  if no matching completions\ncould be added.\n\nabsolutecommandpaths\nThis function completes external commands as absolute paths (un-\nlike  commandnames  -e  which  completes their basenames).  It\ntakes no arguments.\n\nalllabels [ -x ] [ -12VJ ] tag name descr [ command arg ... ]\nThis is a convenient interface to the nextlabel  function  be-\nlow,  implementing  the  loop  shown in the nextlabel example.\nThe command  and  its  arguments  are  called  to  generate  the\nmatches.  The options stored in the parameter name will automat-\nically be inserted into the args passed to  the  command.   Nor-\nmally,  they  are  put directly after the command, but if one of\nthe args is a single hyphen, they are inserted  directly  before\nthat.   If  the  hyphen is the last argument, it will be removed\nfrom the argument list before the command is called.   This  al-\nlows  alllabels  to  be  used  in  almost  all cases where the\nmatches can be generated by a single call to the compadd builtin\ncommand or by a call to one of the utility functions.\n\nFor example:\n\nlocal expl\n...\nif requested foo; then\n...\nalllabels foo expl '...' compadd ... - $matches\nfi\n\nWill complete the strings from the matches parameter, using com-\npadd with additional options which  will  take  precedence  over\nthose generated by alllabels.\n\nalternative [ -O name ] [ -C name ] spec ...\nThis  function is useful in simple cases where multiple tags are\navailable.  Essentially it implements a loop like  the  one  de-\nscribed for the tags function below.\n\nThe  tags to use and the action to perform if a tag is requested\nare described using the specs which are of  the  form:  `tag:de-\nscr:action'.  The tags are offered using tags and if the tag is\nrequested, the action is executed with the given description de-\nscr.   The actions are those accepted by the arguments function\n(described below), excluding the `->state' and `=...' forms.\n\nFor example, the action may be a simple function call:\n\nalternative \\\n'users:user:users' \\\n'hosts:host:hosts'\n\noffers usernames and hostnames as possible matches, generated by\nthe users and hosts functions respectively.\n\nLike  arguments,  this function uses alllabels to execute the\nactions, which will loop over all sets of  tags.   Special  han-\ndling  is only required if there is an additional valid tag, for\nexample inside a function called from alternative.\n\nThe option `-O name' is used in the same way as  by  the  argu-\nments  function.  In other words, the elements of the name array\nwill be passed to compadd when executing an action.\n\nLike tags this function supports the -C option to give  a  dif-\nferent name for the argument context field.\n\narguments [ -nswWCRS ] [ -A pat ] [ -O name ] [ -M matchspec ]\n[ : ] spec ...\narguments [ opt ... ] -- [ -l ] [ -i pats ] [ -s pair ]\n[ helpspec ...]\nThis  function  can be used to give a complete specification for\ncompletion for a command whose arguments  follow  standard  UNIX\noption and argument conventions.\n\nOptions Overview\n\nOptions  to arguments itself must be in separate words, i.e. -s\n-w, not -sw.  The options are followed by  specs  that  describe\noptions and arguments of the analyzed command.  To avoid ambigu-\nity, all options to arguments itself may be separated from  the\nspec forms by a single colon.\n\nThe  `--' form is used to intuit spec forms from the help output\nof the command being analyzed, and is described in detail below.\nThe opts for the `--' form are otherwise the same options as the\nfirst form.  Note that `-s' following `--' has a distinct  mean-\ning from `-s' preceding `--', and both may appear.\n\nThe option switches -s, -S, -A, -w, and -W affect how arguments\nparses the analyzed command line's options.  These switches  are\nuseful for commands with standard argument parsing.\n\nThe options of arguments have the following meanings:\n\n-n     With  this  option, arguments sets the parameter NORMARG\nto the position of  the  first  normal  argument  in  the\n$words  array, i.e. the position after the end of the op-\ntions.  If that argument has not been reached, NORMARG is\nset  to  -1.  The caller should declare `integer NORMARG'\nif the -n option is passed; otherwise  the  parameter  is\nnot used.\n\n-s     Enable option stacking for single-letter options, whereby\nmultiple single-letter options may  be  combined  into  a\nsingle  word.  For example, the two options `-x' and `-y'\nmay be combined into a single word  `-xy'.   By  default,\nevery  word corresponds to a single option name (`-xy' is\na single option named `xy').\n\nOptions beginning with a single hyphen or plus  sign  are\neligible  for  stacking; words beginning with two hyphens\nare not.\n\nNote that -s after -- has a different meaning,  which  is\ndocumented  in  the segment entitled `Deriving spec forms\nfrom the help output'.\n\n-w     In combination with -s, allow option stacking even if one\nor  more  of the options take arguments.  For example, if\n-x takes an argument, with no -s, `-xy' is considered  as\na  single  (unhandled)  option; with -s, -xy is an option\nwith the argument `y'; with both -s and -w,  -xy  is  the\noption  -x and the option -y with arguments to -x (and to\n-y, if it takes arguments) still to  come  in  subsequent\nwords.\n\n-W     This  option takes -w a stage further:  it is possible to\ncomplete single-letter options  even  after  an  argument\nthat occurs in the same word.  However, it depends on the\naction performed whether options will really be completed\nat  this point.  For more control, use a utility function\nlike guard as part of the action.\n\n-C     Modify the curcontext parameter for an action of the form\n`->state'.  This is discussed in detail below.\n\n-R     Return  status 300 instead of zero when a $state is to be\nhandled, in the `->string' syntax.\n\n-S     Do not complete options after a  `--'  appearing  on  the\nline,  and ignore the `--'.  For example, with -S, in the\nline\n\nfoobar -x -- -y\n\nthe `-x' is considered an option, the `-y' is  considered\nan argument, and the `--' is considered to be neither.\n\n-A pat Do  not complete options after the first non-option argu-\nment on the line.  pat is a pattern matching all  strings\nwhich  are not to be taken as arguments.  For example, to\nmake arguments stop completing options after  the  first\nnormal argument, but ignoring all strings starting with a\nhyphen even if they are not described by one of the  opt-\nspecs, the form is `-A \"-*\"'.\n\n-O name\nPass the elements of the array name as arguments to func-\ntions called to execute actions.  This  is  discussed  in\ndetail below.\n\n-M matchspec\nUse  the match specification matchspec for completing op-\ntion names and values.  The default matchspec allows par-\ntial  word completion after `' and `-', such as complet-\ning `-f-b' to `-foo-bar'.  The default matchspec is:\nr:|[-]=* r:|=*\n\nspecs: overview\n\nEach of the following forms is a spec describing individual sets\nof options or arguments on the command line being analyzed.\n\nn:message:action\nn::message:action\nThis  describes  the  n'th  normal argument.  The message\nwill be printed above the matches generated and  the  ac-\ntion  indicates  what  can  be completed in this position\n(see below).  If there are two colons before the  message\nthe  argument  is optional.  If the message contains only\nwhite space, nothing will be printed  above  the  matches\nunless the action adds an explanation string itself.\n\n:message:action\n::message:action\nSimilar, but describes the next argument, whatever number\nthat happens to be.  If all arguments  are  specified  in\nthis  form  in the correct order the numbers are unneces-\nsary.\n\n*:message:action\n*::message:action\n*:::message:action\nThis describes how arguments  (usually  non-option  argu-\nments,  those  not  beginning with - or +) are to be com-\npleted when neither of the first two forms was  provided.\nAny number of arguments can be completed in this fashion.\n\nWith two colons before the message, the words special ar-\nray and the CURRENT special parameter are modified to re-\nfer  only to the normal arguments when the action is exe-\ncuted or evaluated.  With three colons before the message\nthey  are  modified to refer only to the normal arguments\ncovered by this description.\n\noptspec\noptspec:...\nThis describes an option.  The colon  indicates  handling\nfor  one  or  more  arguments to the option; if it is not\npresent, the option is assumed to take no arguments.\n\nThe following forms are available for  the  initial  opt-\nspec, whether or not the option has arguments.\n\n*optspec\nHere  optspec is one of the remaining forms below.\nThis indicates the following optspec  may  be  re-\npeated.   Otherwise if the corresponding option is\nalready present on the command line to the left of\nthe cursor it will not be offered again.\n\n-optname\n+optname\nIn  the  simplest form the optspec is just the op-\ntion name beginning with a minus or a  plus  sign,\nsuch as `-foo'.  The first argument for the option\n(if any) must follow as a separate  word  directly\nafter the option.\n\nEither  of `-+optname' and `+-optname' can be used\nto specify that -optname  and  +optname  are  both\nvalid.\n\nIn all the remaining forms, the leading `-' may be\nreplaced by or paired with `+' in this way.\n\n-optname-\nThe first argument of the  option  must  come  di-\nrectly  after  the  option  name in the same word.\nFor example, `-foo-:...' specifies that  the  com-\npleted   option   and   argument  will  look  like\n`-fooarg'.\n\n-optname+\nThe first argument may  appear  immediately  after\noptname in the same word, or may appear as a sepa-\nrate  word  after  the   option.    For   example,\n`-foo+:...'  specifies  that  the completed option\nand argument will look like  either  `-fooarg'  or\n`-foo arg'.\n\n-optname=\nThe  argument  may  appear as the next word, or in\nsame word as the option name provided that  it  is\nseparated  from  it by an equals sign, for example\n`-foo=arg' or `-foo arg'.\n\n-optname=-\nThe argument to the option must  appear  after  an\nequals sign in the same word, and may not be given\nin the next argument.\n\noptspec[explanation]\nAn explanation string may be appended  to  any  of\nthe  preceding forms of optspec by enclosing it in\nbrackets, as in `-q[query operation]'.\n\nThe verbose style is used to  decide  whether  the\nexplanation  strings are displayed with the option\nin a completion listing.\n\nIf no bracketed explanation string  is  given  but\nthe auto-description style is set and only one ar-\ngument is described for this optspec, the value of\nthe style is displayed, with any appearance of the\nsequence `%d' in it replaced by the message of the\nfirst optarg that follows the optspec; see below.\n\nIt  is  possible for options with a literal `+' or `=' to\nappear, but that character must be  quoted,  for  example\n`-\\+'.\n\nEach  optarg  following  an  optspec must take one of the\nfollowing forms:\n\n:message:action\n::message:action\nAn argument to the option; message and action  are\ntreated  as  for ordinary arguments.  In the first\nform, the argument is mandatory, and in the second\nform it is optional.\n\nThis  group may be repeated for options which take\nmultiple arguments.  In other words, :message1:ac-\ntion1:message2:action2  specifies  that the option\ntakes two arguments.\n\n:*pattern:message:action\n:*pattern::message:action\n:*pattern:::message:action\nThis describes multiple arguments.  Only the  last\noptarg for an option taking multiple arguments may\nbe given in this form.  If the  pattern  is  empty\n(i.e.  :*:),  all  the remaining words on the line\nare to be completed as described  by  the  action;\notherwise,  all  the  words  up to and including a\nword matching the pattern are to be completed  us-\ning the action.\n\nMultiple  colons  are  treated  as for the `*:...'\nforms for ordinary arguments:  when the message is\npreceded  by  two  colons, the words special array\nand the CURRENT  special  parameter  are  modified\nduring  the  execution or evaluation of the action\nto refer only to the words after the option.  When\npreceded by three colons, they are modified to re-\nfer only to the words covered by this description.\n\nAny literal colon in an optname, message, or action must be pre-\nceded by a backslash, `\\:'.\n\nEach of the forms above may be preceded by a list in parentheses\nof option names and argument numbers.  If the given option is on\nthe  command line, the options and arguments indicated in paren-\ntheses  will  not  be  offered.   For  example,  `(-two   -three\n1)-one:...'  completes the option `-one'; if this appears on the\ncommand line, the options -two and -three and the first ordinary\nargument will not be completed after it.  `(-foo):...' specifies\nan ordinary argument completion; -foo will not be  completed  if\nthat argument is already present.\n\nOther  items may appear in the list of excluded options to indi-\ncate various other items that should not  be  applied  when  the\ncurrent specification is matched: a single star (*) for the rest\narguments (i.e. a specification of the form  `*:...');  a  colon\n(:) for all normal (non-option-) arguments; and a hyphen (-) for\nall options.  For example, if `(*)' appears before an option and\nthe  option  appears  on the command line, the list of remaining\narguments (those shown in the above table beginning  with  `*:')\nwill not be completed.\n\nTo aid in reuse of specifications, it is possible to precede any\nof the forms above with `!'; then the form  will  no  longer  be\ncompleted,  although  if  the  option or argument appears on the\ncommand line they will be skipped as normal.  The main  use  for\nthis is when the arguments are given by an array, and arguments\nis called repeatedly for more specific contexts:  on  the  first\ncall  `arguments  $globaloptions'  is  used, and on subsequent\ncalls `arguments !$^globaloptions'.\n\nspecs: actions\n\nIn each of the forms above the action determines how completions\nshould  be generated.  Except for the `->string' form below, the\naction will be executed by calling the alllabels  function  to\nprocess  all  tag labels.  No special handling of tags is needed\nunless a function call introduces a new one.\n\nThe functions called to execute actions will be called with  the\nelements  of  the  array  named by the `-O name' option as argu-\nments.  This can be used, for example, to pass the same  set  of\noptions for the compadd builtin to all actions.\n\nThe forms for action are as follows.\n\n(single unquoted space)\nThis  is  useful  where an argument is required but it is\nnot possible or desirable to  generate  matches  for  it.\nThe  message will be displayed but no completions listed.\nNote that even in this case the colon at the end  of  the\nmessage  is needed; it may only be omitted when neither a\nmessage nor an action is given.\n\n(item1 item2 ...)\nOne of a list of possible matches, for example:\n\n:foo:(foo bar baz)\n\n((item1\\:desc1 ...))\nSimilar to the above, but with descriptions for each pos-\nsible  match.   Note the backslash before the colon.  For\nexample,\n\n:foo:((a\\:bar b\\:baz))\n\nThe matches will be listed together with  their  descrip-\ntions if the description style is set with the values tag\nin the context.\n\n->string\nIn this form, arguments processes the arguments and  op-\ntions  and  then  returns control to the calling function\nwith parameters set to indicate the state of  processing;\nthe  calling function then makes its own arrangements for\ngenerating completions.  For example, functions that  im-\nplement a state machine can use this type of action.\n\nWhere arguments encounters action in the `->string' for-\nmat, it will strip all leading  and  trailing  whitespace\nfrom  string  and  set  the array state to the set of all\nstrings for which an action is to be performed.  The ele-\nments  of  the  array statedescr are assigned the corre-\nsponding message field from each optarg  containing  such\nan action.\n\nBy default and in common with all other well behaved com-\npletion functions, arguments returns status zero  if  it\nwas  able to add matches and non-zero otherwise. However,\nif the -R option is given, arguments will instead return\na status of 300 to indicate that $state is to be handled.\n\nIn  addition  to $state and $statedescr, arguments also\nsets  the  global  parameters   `context',   `line'   and\n`optargs'  as  described  below,  and does not reset any\nchanges made to the special parameters such as PREFIX and\nwords.  This gives the calling function the choice of re-\nsetting these parameters or propagating changes in them.\n\nA function calling arguments with at  least  one  action\ncontaining  a `->string' must therefore declare appropri-\nate local parameters:\n\nlocal context state statedescr line\ntypeset -A optargs\n\nto prevent arguments from altering the  global  environ-\nment.\n\n{eval-string}\nA string in braces is evaluated as shell code to generate\nmatches.  If the eval-string itself does not  begin  with\nan opening parenthesis or brace it is split into separate\nwords before execution.\n\n= action\nIf the action starts with `= ' (an equals  sign  followed\nby  a  space), arguments will insert the contents of the\nargument field of the current context as  the  new  first\nelement  in  the  words  special  array and increment the\nvalue of the CURRENT special parameter.  This has the ef-\nfect  of  inserting a dummy word onto the completion com-\nmand line while not changing the point at  which  comple-\ntion is taking place.\n\nThis  is  most useful with one of the specifiers that re-\nstrict the words on the command line on which the  action\nis  to  operate  (the  two- and three-colon forms above).\nOne particular use is when an action itself causes argu-\nments  on a restricted range; it is necessary to use this\ntrick to insert an  appropriate  command  name  into  the\nrange  for  the  second  call to arguments to be able to\nparse the line.\n\nword...\nword...\nThis covers all forms other than those above.  If the ac-\ntion  starts  with  a  space, the remaining list of words\nwill be invoked unchanged.\n\nOtherwise it will be  invoked  with  some  extra  strings\nplaced  after the first word; these are to be passed down\nas options to the compadd builtin.  They ensure that  the\nstate specified by arguments, in particular the descrip-\ntions of options and arguments, is  correctly  passed  to\nthe  completion  command.  These additional arguments are\ntaken from the array parameter `expl'; this will  be  set\nup  before executing the action and hence may be referred\nto inside it, typically  in  an  expansion  of  the  form\n`$expl[@]' which preserves empty elements of the array.\n\nDuring  the  performance  of the action the array `line' will be\nset to the normal arguments from  the  command  line,  i.e.  the\nwords from the command line after the command name excluding all\noptions and their arguments.  Options are stored in the associa-\ntive  array `optargs' with option names as keys and their argu-\nments as the values.  For options that have more than one  argu-\nment  these  are  given as one string, separated by colons.  All\ncolons and backslashes in the original  arguments  are  preceded\nwith backslashes.\n\nThe  parameter  `context'  is  set when returning to the calling\nfunction to perform an action of the form `->string'.  It is set\nto an array of elements corresponding to the elements of $state.\nEach element is a suitable name for the argument  field  of  the\ncontext: either a string of the form `option-opt-n' for the n'th\nargument of the option -opt, or a  string  of  the  form  `argu-\nment-n'  for  the  n'th argument.  For `rest' arguments, that is\nthose in the list at the end not handled by position, n  is  the\nstring `rest'.  For example, when completing the argument of the\n-o option, the name is `option-o-1', while for the second normal\n(non-option-) argument it is `argument-2'.\n\nFurthermore,  during  the  evaluation  of the action the context\nname in the curcontext parameter is altered to append  the  same\nstring that is stored in the context parameter.\n\nThe  option -C tells arguments to modify the curcontext parame-\nter for an action of the form `->state'.  This is  the  standard\nparameter  used  to  keep track of the current context.  Here it\n(and not the context array) should be made local to the  calling\nfunction  to avoid passing back the modified value and should be\ninitialised to the current value at the start of the function:\n\nlocal curcontext=\"$curcontext\"\n\nThis is useful where it is not possible for multiple  states  to\nbe valid together.\n\nGrouping Options\n\nOptions  can  be grouped to simplify exclusion lists. A group is\nintroduced with `+' followed by a name for the group in the sub-\nsequent  word.  Whole groups can then be referenced in an exclu-\nsion list or a group name can be used  to  disambiguate  between\ntwo forms of the same option. For example:\n\narguments \\\n'(group2--x)-a' \\\n+ group1 \\\n-m \\\n'(group2)-n' \\\n+ group2 \\\n-x -y\n\nIf  the  name  of a group is specified in the form `(name)' then\nonly one value from that group will ever be completed; more for-\nmally,  all  specifications  are mutually exclusive to all other\nspecifications in that group. This is useful  for  defining  op-\ntions that are aliases for each other. For example:\n\narguments \\\n-a -b \\\n+ '(operation)' \\\n{-c,--compress}'[compress]' \\\n{-d,--decompress}'[decompress]' \\\n{-l,--list}'[list]'\n\nIf  an  option  in  a  group  appears on the command line, it is\nstored in the associative array `optargs'  with  'group-option'\nas a key.  In the example above, a key `operation--c' is used if\nthe option `-c' is present on the command line.\n\nSpecifying Multiple Sets of Arguments\n\nIt is possible to specify multiple sets of options and arguments\nwith  the  sets  separated  by single hyphens. This differs from\ngroups in that sets are considered to be mutually  exclusive  of\neach other.\n\nSpecifications  before the first set and from any group are com-\nmon to all sets. For example:\n\narguments \\\n-a \\\n- set1 \\\n-c \\\n- set2 \\\n-d \\\n':arg:(x2 y2)'\n\nThis defines two sets.  When the command line contains  the  op-\ntion  `-c', the `-d' option and the argument will not be consid-\nered possible completions.  When it contains `-d'  or  an  argu-\nment,  the  option  `-c' will not be considered.  However, after\n`-a' both sets will still be considered valid.\n\nAs for groups, the name of a set may appear in exclusion  lists,\neither alone or preceding a normal option or argument specifica-\ntion.\n\nThe completion code has to parse the command line separately for\neach set. This can be slow so sets should only be used when nec-\nessary.  A useful alternative is often an  option  specification\nwith  rest-arguments  (as in `-foo:*:...'); here the option -foo\nswallows up all remaining arguments as described by  the  optarg\ndefinitions.\n\nDeriving spec forms from the help output\n\nThe  option `--' allows arguments to work out the names of long\noptions that support the `--help' option which  is  standard  in\nmany GNU commands.  The command word is called with the argument\n`--help' and the output examined for option names.  Clearly,  it\ncan  be dangerous to pass this to commands which may not support\nthis option as the behaviour of the command is unspecified.\n\nIn addition to options, `arguments --' will try to  deduce  the\ntypes   of   arguments  available  for  options  when  the  form\n`--opt=val' is valid.  It is also possible to provide  hints  by\nexamining  the  help  text of the command and adding helpspec of\nthe form `pattern:message:action'; note  that  other  arguments\nspec  forms  are  not  used.  The pattern is matched against the\nhelp text for an option, and if it matches the message  and  ac-\ntion  are  used  as  for other argument specifiers.  The special\ncase of `*:' means both message and action are empty, which  has\nthe  effect of causing options having no description in the help\noutput to be ordered in listings ahead of options  that  have  a\ndescription.\n\nFor example:\n\narguments -- '*\\*:toggle:(yes no)' \\\n'*=FILE*:file:files' \\\n'*=DIR*:directory:files -/' \\\n'*=PATH*:directory:files -/'\n\nHere,  `yes'  and  `no' will be completed as the argument of op-\ntions whose description ends in a star; file names will be  com-\npleted for options that contain the substring `=FILE' in the de-\nscription; and directories will be completed for  options  whose\ndescription  contains  `=DIR' or `=PATH'.  The last three are in\nfact the default and so need not be given  explicitly,  although\nit is possible to override the use of these patterns.  A typical\nhelp text which uses this feature is:\n\n-C, --directory=DIR          change to directory DIR\n\nso that the above specifications will cause  directories  to  be\ncompleted after `--directory', though not after `-C'.\n\nNote also that arguments tries to find out automatically if the\nargument for an option is optional.  This can be  specified  ex-\nplicitly by doubling the colon before the message.\n\nIf the pattern ends in `(-)', this will be removed from the pat-\ntern and the action will be used only directly  after  the  `=',\nnot  in the next word.  This is the behaviour of a normal speci-\nfication defined with the form `=-'.\n\nBy default, the command (with the option `--help') is run  after\nresetting  all  the  locale  categories (except for LCCTYPE) to\n`C'.  If the localized help output is known to work, the  option\n`-l' can be specified after the `arguments --' so that the com-\nmand is run in the current locale.\n\nThe `arguments --' can be followed by the option `-i  patterns'\nto give patterns for options which are not to be completed.  The\npatterns can be given as the name of an array parameter or as  a\nliteral list in parentheses.  For example,\n\narguments -- -i \\\n\"(--(en|dis)able-FEATURE*)\"\n\nwill  cause  completion to ignore the options `--enable-FEATURE'\nand `--disable-FEATURE' (this example is useful with GNU config-\nure).\n\nThe  `arguments --' form can also be followed by the option `-s\npair' to describe option aliases.  The pair consists of  a  list\nof alternating patterns and corresponding replacements, enclosed\nin parens and quoted so that it forms a single argument word  in\nthe arguments call.\n\nFor example, some configure-script help output describes options\nonly as `--enable-foo', but the script also accepts the  negated\nform `--disable-foo'.  To allow completion of the second form:\n\narguments -- -s \"((#s)--enable- --disable-)\"\n\nMiscellaneous notes\n\nFinally,  note  that arguments generally expects to be the pri-\nmary function handling any completion for which it is used.   It\nmay  have side effects which change the treatment of any matches\nadded by other functions called after it.  To combine arguments\nwith  other  functions,  those functions should be called either\nbefore arguments, as an action within a spec,  or  in  handlers\nfor `->state' actions.\n\nHere is a more general example of the use of arguments:\n\narguments '-l+:left border:' \\\n'-format:paper size:(letter A4)' \\\n'*-copy:output file:files::resolution:(300 600)' \\\n':postscript file:files -g \\*.\\(ps\\|eps\\)' \\\n'*:page number:'\n\nThis describes three options: `-l', `-format', and `-copy'.  The\nfirst takes one argument described as `left border' for which no\ncompletion will be offered because of the empty action.  Its ar-\ngument may come directly after the `-l' or it may  be  given  as\nthe next word on the line.\n\nThe  `-format'  option  takes one argument in the next word, de-\nscribed as `paper size' for which only the strings `letter'  and\n`A4' will be completed.\n\nThe `-copy' option may appear more than once on the command line\nand takes two arguments.  The first is  mandatory  and  will  be\ncompleted as a filename.  The second is optional (because of the\nsecond colon before the description `resolution')  and  will  be\ncompleted from the strings `300' and `600'.\n\nThe  last two descriptions say what should be completed as argu-\nments.  The first describes the first argument as a  `postscript\nfile' and makes files ending in `ps' or `eps' be completed.  The\nlast description gives all other arguments the description `page\nnumbers' but does not offer completions.\n\ncacheinvalid cacheidentifier\nThis  function returns status zero if the completions cache cor-\nresponding to the given cache identifier needs  rebuilding.   It\ndetermines  this  by  looking  up the cache-policy style for the\ncurrent context.  This should provide a function name  which  is\nrun  with  the  full path to the relevant cache file as the only\nargument.\n\nExample:\n\nexamplecachingpolicy () {\n# rebuild if cache is more than a week old\nlocal -a oldp\noldp=( \"$1\"(Nm+7) )\n(( $#oldp ))\n}\n\ncallfunction return name [ arg ... ]\nIf a function name exists, it is called with the arguments args.\nThe  return  argument gives the name of a parameter in which the\nreturn status from the function name should be stored; if return\nis empty or a single hyphen it is ignored.\n\nThe  return status of callfunction itself is zero if the func-\ntion name exists and was called and non-zero otherwise.\n\ncallprogram [ -l ] [ -p ] tag string ...\nThis function provides a mechanism for the user to override  the\nuse  of an external command.  It looks up the command style with\nthe supplied tag.  If the style is set, its value is used as the\ncommand to execute.  The strings from the call to callprogram,\nor from the style if set, are concatenated with  spaces  between\nthem  and  the resulting string is evaluated.  The return status\nis the return status of the command called.\n\nBy default, the command is run in an environment where  all  the\nlocale  categories  (except  for  LCCTYPE)  are reset to `C' by\ncalling the utility function complocale (see  below).  If  the\noption  `-l'  is  given, the command is run with the current lo-\ncale.\n\nIf the option `-p' is supplied it  indicates  that  the  command\noutput  is  influenced by the permissions it is run with. If the\ngain-privileges style is set to true,  callprogram  will  make\nuse of commands such as sudo, if present on the command-line, to\nmatch the permissions to whatever the final command is likely to\nrun  under.  When  looking  up  the  gain-privileges and command\nstyles, the command component of the  zstyle  context  will  end\nwith a slash (`/') followed by the command that would be used to\ngain privileges.\n\ncombination [ -s pattern ] tag style spec ... field opts ...\nThis function is used to complete combinations of  values,   for\nexample  pairs  of  hostnames and usernames.  The style argument\ngives the style which defines the pairs; it is looked  up  in  a\ncontext with the tag specified.\n\nThe style name consists of field names separated by hyphens, for\nexample `users-hosts-ports'.  For each field for a value is  al-\nready  known,  a spec of the form `field=pattern' is given.  For\nexample, if the command line so far specifies a user `pws',  the\nargument `users=pws' should appear.\n\nThe  next  argument  with no equals sign is taken as the name of\nthe field for which completions should be generated  (presumably\nnot one of the fields for which the value is known).\n\nThe matches generated will be taken from the value of the style.\nThese should contain the possible values for the combinations in\nthe  appropriate  order  (users,  hosts,  ports  in  the example\nabove).  The values for the different fields  are  separated  by\ncolons.   This can be altered with the option -s to combination\nwhich specifies a pattern.  Typically this is a character class,\nas for example `-s \"[:@]\"' in the case of the users-hosts style.\nEach `field=pattern'  specification  restricts  the  completions\nwhich apply to elements of the style with appropriately matching\nfields.\n\nIf no style with the given name is defined for the given tag, or\nif  none  of  the strings in style's value match, but a function\nname of the required field preceded by an underscore is defined,\nthat function will be called to generate the matches.  For exam-\nple, if there is no `users-hosts-ports' or no matching  hostname\nwhen  a  host  is required, the function `hosts' will automati-\ncally be called.\n\nIf the same name is used for more than one field,  in  both  the\n`field=pattern'  and  the  argument  that  gives the name of the\nfield to be completed, the number of the  field  (starting  with\none)  may  be  given after the fieldname, separated from it by a\ncolon.\n\nAll arguments after the required field name are passed  to  com-\npadd  when  generating  matches  from the style value, or to the\nfunctions for the fields if they are called.\n\ncommandnames [ -e | - ]\nThis function completes words that are valid  at  command  posi-\ntion:  names  of  aliases, builtins, hashed commands, functions,\nand so on.  With the -e flag,  only  hashed  commands  are  com-\npleted.  The - flag is ignored.\n\ncomplocale\nThis  function  resets  all  the  locale  categories  other than\nLCCTYPE to `C' so that the output from external commands can be\neasily  analyzed  by the completion system. LCCTYPE retains the\ncurrent value (taking LCALL and LANG  into  account),  ensuring\nthat  non-ASCII characters in file names are still handled prop-\nerly.\n\nThis function should normally be run only in a subshell, because\nthe  new  locale  is  exported to the environment. Typical usage\nwould be `$(complocale; command ...)'.\n\ncompleters [ -p ]\nThis function completes names of completers.\n\n-p     Include the leading underscore (`') in the matches.\n\ndescribe [-12JVx] [ -oO | -t tag ] descr name1 [ name2 ] [ opt ... ]\n[ -- name1 [ name2 ] [ opt ... ] ... ]\nThis function associates completions with descriptions.   Multi-\nple  groups  separated  by  -- can be supplied, potentially with\ndifferent completion options opts.\n\nThe descr is taken as a string to display above the  matches  if\nthe  format style for the descriptions tag is set.  This is fol-\nlowed by one or two names of arrays followed by options to  pass\nto  compadd.   The array name1 contains the possible completions\nwith their descriptions in  the  form  `completion:description'.\nAny  literal  colons  in  completion must be quoted with a back-\nslash.  If a name2 is given, it should have the same  number  of\nelements  as  name1; in this case the corresponding elements are\nadded as possible completions instead of the completion  strings\nfrom  name1.   The  completion list will retain the descriptions\nfrom name1.  Finally, a set of completion options can appear.\n\nIf the option  `-o'  appears  before  the  first  argument,  the\nmatches  added will be treated as names of command options (N.B.\nnot shell options), typically following a `-', `--'  or  `+'  on\nthe  command  line.  In this case describe uses the prefix-hid-\nden, prefix-needed and verbose styles to find out if the strings\nshould be added as completions and if the descriptions should be\nshown.  Without the `-o' option, only the verbose style is  used\nto  decide  how descriptions are shown.  If `-O' is used instead\nof `-o', command options are completed as  above  but  describe\nwill not handle the prefix-needed style.\n\nWith the -t option a tag can be specified.  The default is `val-\nues' or, if the -o option is given, `options'.\n\nThe options -1, -2, -J, -V, -x are passed to nextlabel.\n\nIf selected by the list-grouped style, strings with the same de-\nscription will appear together in the list.\n\ndescribe uses the alllabels function to generate the matches,\nso it does not need to appear inside a loop over tag labels.\n\ndescription [ -x ] [ -12VJ ] tag name descr [ spec ... ]\nThis function is not to be confused with the previous one; it is\nused  as  a helper function for creating options to compadd.  It\nis buried inside many of the higher level  completion  functions\nand so often does not need to be called directly.\n\nThe  styles listed below are tested in the current context using\nthe given tag.  The resulting options for compadd are  put  into\nthe  array  named  name  (this is traditionally `expl', but this\nconvention is not enforced).  The  description  for  the  corre-\nsponding set of matches is passed to the function in descr.\n\nThe styles tested are: format, hidden, matcher, ignore-line, ig-\nnored-patterns, group-name and sort.  The format style is  first\ntested for the given tag and then for the descriptions tag if no\nvalue was found, while the remainder are only tested for the tag\ngiven  as  the  first  argument.  The function also calls setup\nwhich tests some more styles.\n\nThe string returned by the format style (if any) will  be  modi-\nfied so that the sequence `%d' is replaced by the descr given as\nthe third argument without any leading or trailing white  space.\nIf,  after  removing  the  white  space,  the descr is the empty\nstring, the format style will not be used and  the  options  put\ninto the name array will not contain an explanation string to be\ndisplayed above the matches.\n\nIf description is called with more than  three  arguments,  the\nadditional specs should be of the form `char:str'.  These supply\nescape sequence replacements for the format style: every appear-\nance of `%char' will be replaced by string.\n\nIf  the  -x  option  is given, the description will be passed to\ncompadd using the -x option instead of  the  default  -X.   This\nmeans  that  the description will be displayed even if there are\nno corresponding matches.\n\nThe options placed  in  the  array  name  take  account  of  the\ngroup-name  style,  so  matches  are  placed in a separate group\nwhere necessary.  The group normally has its elements sorted (by\npassing  the  option  -J  to compadd), but if an option starting\nwith `-V', `-J', `-1', or `-2' is passed to  description,  that\noption  will be included in the array.  Hence it is possible for\nthe completion group to be unsorted by giving the  option  `-V',\n`-1V', or `-2V'.\n\nIn most cases, the function will be used like this:\n\nlocal expl\ndescription files expl file\ncompadd \"$expl[@]\" - \"$files[@]\"\n\nNote  the use of the parameter expl, the hyphen, and the list of\nmatches.  Almost all calls to compadd within the completion sys-\ntem  use  a  similar  format;  this  ensures that user-specified\nstyles are correctly passed down to the builtins which implement\nthe internals of completion.\n\ndirlist [ -s sep ] [ -S ]\nComplete a list of directory names separated by colons (the same\nformat as $PATH).\n\n-s sep Use sep as separator between items.  sep  defaults  to  a\ncolon (`:').\n\n-S     Add  sep instead of slash (`/') as an autoremoveable suf-\nfix.\n\ndispatch context string ...\nThis sets the current context to context and looks  for  comple-\ntion  functions  to  handle  this context by hunting through the\nlist of command names or special contexts  (as  described  above\nfor compdef) given as strings.  The first completion function to\nbe defined for one of the contexts in the list is used to gener-\nate  matches.   Typically, the last string is -default- to cause\nthe function for default completion to be used as a fallback.\n\nThe function sets the parameter $service  to  the  string  being\ntried,  and  sets  the context/command field (the fourth) of the\n$curcontext parameter to the context given as  the  first  argu-\nment.\n\nemailaddresses [ -c ] [ -n plugin ]\nComplete email addresses.  Addresses are provided by plugins.\n\n-c     Complete  bare  localhost@domain.tld addresses, without a\nname part or a  comment.   Without  this  option,  RFC822\n`Firstname Lastname <address>' strings are completed.\n\n-n plugin\nComplete aliases from plugin.\n\nThe following plugins are available by default: email-ldap (see\nthe filter style), email-local  (completes  user@hostname  Unix\naddresses),  email-mail  (completes  aliases  from  ~/.mailrc),\nemail-mush, email-mutt, and email-pine.\n\nAddresses from the email-foo plugin are  added  under  the  tag\n`email-foo'.\n\nWriting plugins\n\nPlugins  are  written  as separate functions with names starting\nwith `email-'.  They are invoked with the -c option and compadd\noptions.   They should either do their own completion or set the\n$reply array to a list of `alias:address'  elements  and  return\n300.  New plugins will be picked up and run automatically.\n\nfiles The function files is a wrapper around pathfiles. It supports\nall of the same functionality, with  some  enhancements  --  no-\ntably,  it  respects  the  list-dirs-first  style, and it allows\nusers to override the behaviour of the -g and  -/  options  with\nthe  file-patterns  style.  files should therefore be preferred\nover pathfiles in most cases.\n\nThis function  accepts  the  full  set  of  options  allowed  by\npathfiles, described below.\n\ngnugeneric\nThis function is a simple wrapper around the arguments function\ndescribed above.  It can be used to determine automatically  the\nlong  options  understood  by  commands that produce a list when\npassed the option `--help'.  It is intended  to  be  used  as  a\ntop-level completion function in its own right.  For example, to\nenable option completion for the commands foo and bar, use\n\ncompdef gnugeneric foo bar\n\nafter the call to compinit.\n\nThe completion system as supplied is conservative in its use  of\nthis  function, since it is important to be sure the command un-\nderstands the option `--help'.\n\nguard [ options ] pattern descr\nThis function displays descr if pattern matches the string to be\ncompleted.   It  is  intended  to  be used in the action for the\nspecifications passed to arguments and similar functions.\n\nThe return status is zero if the message was displayed  and  the\nword to complete is not empty, and non-zero otherwise.\n\nThe  pattern may be preceded by any of the options understood by\ncompadd that are passed down from description, namely  -M,  -J,\n-V,  -1,  -2,  -n,  -F and -X.  All of these options will be ig-\nnored.  This fits in conveniently with the argument-passing con-\nventions of actions for arguments.\n\nAs  an  example,  consider  a  command taking the options -n and\n-none, where -n must be followed by a numeric value in the  same\nword.  By using:\n\narguments '-n-: :guard \"[0-9]#\" \"numeric value\"' '-none'\n\narguments  can  be  made  to  both display the message `numeric\nvalue' and complete options after `-n<TAB>'.  If the `-n' is al-\nready  followed  by  one  or  more digits (the pattern passed to\nguard) only the message will be displayed; if the `-n' is  fol-\nlowed by another character, only options are completed.\n\nmessage [ -r12 ] [ -VJ group ] descr\nmessage -e [ tag ] descr\nThe  descr  is used in the same way as the third argument to the\ndescription function, except that the resulting string will al-\nways  be  shown  whether or not matches were generated.  This is\nuseful for displaying a help message in places where no  comple-\ntions can be generated.\n\nThe  format  style  is  examined with the messages tag to find a\nmessage; the usual tag, descriptions, is used only if the  style\nis not set with the former.\n\nIf  the -r option is given, no style is used; the descr is taken\nliterally as the string to display.  This is  most  useful  when\nthe descr comes from a pre-processed argument list which already\ncontains an expanded description.  Note that  this  option  does\nnot disable the `%'-sequence parsing done by compadd.\n\nThe  -12VJ options and the group are passed to compadd and hence\ndetermine the group the message string is added to.\n\nThe second -e form gives a description for completions with  the\ntag  tag  to be shown even if there are no matches for that tag.\nThis form is called by arguments in the event that there is  no\naction  for an option specification.  The tag can be omitted and\nif so the tag is taken from the parameter $curtag; this is main-\ntained by the completion system and so is usually correct.  Note\nthat if there are no  matches  at  the  time  this  function  is\ncalled, compstate[insert] is cleared, so additional matches gen-\nerated later are not inserted on the command line.\n\nmultiparts [ -i ] sep array\nThe argument sep is a separator character.  The array may be ei-\nther  the  name  of an array parameter or a literal array in the\nform `(foo bar)', a parenthesised list  of  words  separated  by\nwhitespace.   The  possible completions are the strings from the\narray.  However, each chunk delimited by sep will  be  completed\nseparately.  For example, the tar function uses `multiparts /\npatharray' to complete partial file paths from the  given  array\nof complete file paths.\n\nThe  -i option causes multiparts to insert a unique match even\nif that requires multiple separators to be  inserted.   This  is\nnot  usually  the expected behaviour with filenames, but certain\nother types of completion, for example those with a fixed set of\npossibilities, may be more suited to this form.\n\nLike  other  utility  functions, this function accepts the `-V',\n`-J', `-1', `-2', `-n', `-f',  `-X',  `-M',  `-P',  `-S',  `-r',\n`-R', and `-q' options and passes them to the compadd builtin.\n\nnextlabel [ -x ] [ -12VJ ] tag name descr [ option ... ]\nThis  function  is used to implement the loop over different tag\nlabels for a particular tag as described above for the tag-order\nstyle.   On each call it checks to see if there are any more tag\nlabels; if there is it returns status zero, otherwise  non-zero.\nAs  this  function requires a current tag to be set, it must al-\nways follow a call to tags or requested.\n\nThe -x12VJ options and the first three arguments are  passed  to\nthe  description  function.   Where appropriate the tag will be\nreplaced by a tag label in this call.  Any description given  in\nthe  tag-order  style  is  preferred  to  the  descr  passed  to\nnextlabel.\n\nThe options given after the descr are set in the parameter given\nby name, and hence are to be passed to compadd or whatever func-\ntion is called to add the matches.\n\nHere is a typical use of this function for  the  tag  foo.   The\ncall to requested determines if tag foo is required at all; the\nloop over nextlabel handles any labels defined for the tag  in\nthe tag-order style.\n\nlocal expl ret=1\n...\nif requested foo; then\n...\nwhile nextlabel foo expl '...'; do\ncompadd \"$expl[@]\" ... && ret=0\ndone\n...\nfi\nreturn ret\n\nnormal [ -P | -p precommand ]\nThis  is  the standard function called to handle completion out-\nside any special -context-.  It is called both to  complete  the\ncommand  word and also the arguments for a command.  In the sec-\nond case, normal looks for a special completion for  that  com-\nmand,  and  if there is none it uses the completion for the -de-\nfault- context.\n\nA second use is to reexamine the command line specified  by  the\n$words  array  and  the $CURRENT parameter after those have been\nmodified.  For example, the  function  precommand,  which  com-\npletes  after  precommand  specifiers such as nohup, removes the\nfirst word from the words array, decrements the CURRENT  parame-\nter,  then calls `normal -p $service'.  The effect is that `no-\nhup cmd ...' is treated in the same way as `cmd ...'.\n\n-P     Reset the list of precommands. This option should be used\nif  completing  a command line which allows internal com-\nmands (e.g. builtins and functions) regardless  of  prior\nprecommands (e.g. `zsh -c').\n\n-p precommand\nAppend precommand to the list of precommands. This option\nshould be used in nearly all cases in which -P is not ap-\nplicable.\n\nIf  the command name matches one of the patterns given by one of\nthe options -p or -P to compdef,  the  corresponding  completion\nfunction  is called and then the parameter compskip is checked.\nIf it is set completion is terminated at that point even  if  no\nmatches  have  been  found.   This  is the same effect as in the\n-first- context.\n\noptions\nThis can be used to complete the names  of  shell  options.   It\nprovides  a  matcher  specification that ignores a leading `no',\nignores underscores and allows upper-case letters to match their\nlower-case   counterparts   (for   example,   `glob',  `noglob',\n`NOGLOB' are all completed).  Any arguments are  propagated  to\nthe compadd builtin.\n\noptionsset and optionsunset\nThese  functions  complete  only  set or unset options, with the\nsame matching specification used in the options function.\n\nNote that you need to uncomment a few lines  in  the  maincom-\nplete  function for these functions to work properly.  The lines\nin question are used to store the option settings in effect  be-\nfore  the  completion  widget locally sets the options it needs.\nHence these functions are not generally used by  the  completion\nsystem.\n\nparameters\nThis is used to complete the names of shell parameters.\n\nThe  option  `-g  pattern'  limits  the completion to parameters\nwhose type matches the pattern.  The type of a parameter is that\nshown by `print ${(t)param}', hence judicious use of `*' in pat-\ntern is probably necessary.\n\nAll other arguments are passed to the compadd builtin.\n\npathfiles\nThis function is used throughout the completion system  to  com-\nplete  filenames.   It  allows completion of partial paths.  For\nexample, the string `/u/i/s/sig' may be completed  to  `/usr/in-\nclude/sys/signal.h'.\n\nThe options accepted by both pathfiles and files are:\n\n-f     Complete all filenames.  This is the default.\n\n-/     Specifies that only directories should be completed.\n\n-g pattern\nSpecifies  that only files matching the pattern should be\ncompleted.\n\n-W paths\nSpecifies path prefixes that are to be prepended  to  the\nstring  from  the  command line to generate the filenames\nbut that should not be inserted as completions nor  shown\nin  completion  listings.  Here, paths may be the name of\nan array parameter, a literal list of paths  enclosed  in\nparentheses or an absolute pathname.\n\n-F ignored-files\nThis  behaves as for the corresponding option to the com-\npadd builtin.  It gives direct control over  which  file-\nnames  should  be ignored.  If the option is not present,\nthe ignored-patterns style is used.\n\nBoth pathfiles and files also accept  the  following  options\nwhich are passed to compadd: `-J', `-V', `-1', `-2', `-n', `-X',\n`-M', `-P', `-S', `-q', `-r', and `-R'.\n\nFinally, the pathfiles function  uses the styles  expand,  am-\nbiguous,  special-dirs,  list-suffixes  and  file-sort described\nabove.\n\npickvariant [ -b builtin-label ] [ -c command ] [ -r name ]\nlabel=pattern ... label [ arg ... ]\nThis function is used to resolve situations where a single  com-\nmand  name  requires  more than one type of handling, either be-\ncause it has more than one variant or because there  is  a  name\nclash between two different commands.\n\nThe  command to run is taken from the first element of the array\nwords unless this is overridden by the option -c.  This  command\nis  run  and  its  output is compared with a series of patterns.\nArguments to be passed to the command can be  specified  at  the\nend after all the other arguments.  The patterns to try in order\nare given by the arguments label=pattern; if the output of `com-\nmand  arg  ...'  contains pattern, then label is selected as the\nlabel for the command variant.  If none of the  patterns  match,\nthe final command label is selected and status 1 is returned.\n\nIf the `-b builtin-label' is given, the command is tested to see\nif it is provided as a shell builtin,  possibly  autoloaded;  if\nso,  the  label  builtin-label  is selected as the label for the\nvariant.\n\nIf the `-r name' is given, the label picked is stored in the pa-\nrameter named name.\n\nThe  results are also cached in the cmdvariant associative ar-\nray indexed by the name of the command run.\n\nregexarguments name spec ...\nThis function generates a completion function name which matches\nthe  specifications  specs,  a set of regular expressions as de-\nscribed below.  After  running  regexarguments,  the  function\nname should be called as a normal completion function.  The pat-\ntern to be matched is given by the contents of the  words  array\nup  to  the  current  cursor  position joined together with null\ncharacters; no quotation is applied.\n\nThe arguments are grouped as sets of alternatives  separated  by\n`|',  which  are  tried  one  after the other until one matches.\nEach alternative consists of a one or more specifications  which\nare  tried  left  to  right,  with  each  pattern  matched being\nstripped in turn from the command line being tested,  until  all\nof  the  group  succeeds or until one fails; in the latter case,\nthe next alternative is tried.  This structure can  be  repeated\nto  arbitrary depth by using parentheses; matching proceeds from\ninside to outside.\n\nA special procedure is applied if no test succeeds but  the  re-\nmaining command line string contains no null character (implying\nthe remaining word is the one for which completions  are  to  be\ngenerated).   The completion target is restricted to the remain-\ning word and any actions for the corresponding patterns are exe-\ncuted.   In this case, nothing is stripped from the command line\nstring.  The order of evaluation of the actions  can  be  deter-\nmined  by  the tag-order style; the various formats supported by\nalternative can be used in action.  The descr is used for  set-\nting up the array parameter expl.\n\nSpecification  arguments  take  one of following forms, in which\nmetacharacters such as `(', `)', `#' and `|' should be quoted.\n\n/pattern/ [%lookahead%] [-guard] [:tag:descr:action]\nThis is a single primitive component.  The function tests\nwhether   the  combined  pattern  `(#b)((#B)pattern)look-\nahead*' matches the command line string.  If so,  `guard'\nis  evaluated and its return status is examined to deter-\nmine if the test has succeeded.  The pattern string  `[]'\nis  guaranteed  never  to  match.   The  lookahead is not\nstripped from the command line before the next pattern is\nexamined.\n\nThe  argument  starting with : is used in the same manner\nas an argument to alternative.\n\nA component is used as follows: pattern is tested to  see\nif  the component already exists on the command line.  If\nit does, any following  specifications  are  examined  to\nfind  something  to  complete.  If a component is reached\nbut no such pattern exists yet on the command  line,  the\nstring  containing the action is used to generate matches\nto insert at that point.\n\n/pattern/+ [%lookahead%] [-guard] [:tag:descr:action]\nThis is similar to `/pattern/ ...' but the left  part  of\nthe command line string (i.e. the part already matched by\nprevious patterns) is also considered part of the comple-\ntion target.\n\n/pattern/- [%lookahead%] [-guard] [:tag:descr:action]\nThis is similar to `/pattern/ ...' but the actions of the\ncurrent and previously matched patterns are ignored  even\nif the following `pattern' matches the empty string.\n\n( spec )\nParentheses may be used to groups specs; note each paren-\nthesis is a single argument to regexarguments.\n\nspec # This allows any number of repetitions of spec.\n\nspec spec\nThe two specs are to be matched one after  the  other  as\ndescribed above.\n\nspec | spec\nEither of the two specs can be matched.\n\nThe  function  regexwords  can be used as a helper function to\ngenerate matches for a set of alternative  words  possibly  with\ntheir own arguments as a command line argument.\n\nExamples:\n\nregexarguments tst /$'[^\\0]#\\0'/ \\\n/$'[^\\0]#\\0'/ :'compadd aaa'\n\nThis  generates  a  function tst that completes aaa as its only\nargument.  The tag and description  for  the  action  have  been\nomitted for brevity (this works but is not recommended in normal\nuse).  The first component matches the command  word,  which  is\narbitrary; the second matches  any argument.  As the argument is\nalso arbitrary, any following component would not depend on  aaa\nbeing present.\n\nregexarguments tst /$'[^\\0]#\\0'/ \\\n/$'aaa\\0'/ :'compadd aaa'\n\nThis  is  a  more  typical use; it is similar, but any following\npatterns would only match if aaa was present as the first  argu-\nment.\n\nregexarguments tst /$'[^\\0]#\\0'/ \\( \\\n/$'aaa\\0'/ :'compadd aaa' \\\n/$'bbb\\0'/ :'compadd bbb' \\) \\#\n\nIn  this  example, an indefinite number of command arguments may\nbe completed.  Odd arguments are completed as aaa and even argu-\nments  as  bbb.   Completion fails unless the set of aaa and bbb\narguments before the current one is matched correctly.\n\nregexarguments tst /$'[^\\0]#\\0'/ \\\n\\( /$'aaa\\0'/ :'compadd aaa' \\| \\\n/$'bbb\\0'/ :'compadd bbb' \\) \\#\n\nThis is similar, but either aaa or bbb may be completed for  any\nargument.  In this case regexwords could be used to generate a\nsuitable expression for the arguments.\n\nregexwords tag description spec ...\nThis  function  can  be  used  to  generate  arguments  for  the\nregexarguments  command  which  may  be  inserted at any point\nwhere a set of rules is expected.  The tag and description  give\na  standard  tag  and description pertaining to the current con-\ntext.  Each spec contains two or three arguments separated by  a\ncolon: note that there is no leading colon in this case.\n\nEach  spec  gives one of a set of words that may be completed at\nthis point, together with arguments.  It is thus roughly equiva-\nlent  to the arguments function when used in normal (non-regex)\ncompletion.\n\nThe part of the spec before the first colon is the  word  to  be\ncompleted.   This  may  contain a *; the entire word, before and\nafter the * is completed, but only the text before the * is  re-\nquired  for the context to be matched, so that further arguments\nmay be completed after the abbreviated form.\n\nThe second part of spec is a description for the word being com-\npleted.\n\nThe  optional third part of the spec describes how words follow-\ning the one being completed are themselves to be completed.   It\nwill be evaluated in order to avoid problems with quoting.  This\nmeans that typically it contains a reference to  an  array  con-\ntaining previously generated regex arguments.\n\nThe  option  -t term specifies a terminator for the word instead\nof the usual space.  This is handled as an auto-removable suffix\nin the manner of the option -s sep to values.\n\nThe  result  of  the processing by regexwords is placed in the\narray reply, which should be made local to the calling function.\nIf the set of words and arguments may be matched repeatedly, a #\nshould be appended to the generated array at that point.\n\nFor example:\n\nlocal -a reply\nregexwords mydb-commands 'mydb commands' \\\n'add:add an entry to mydb:$mydbaddcmds' \\\n'show:show entries in mydb'\nregexarguments mydb \"$reply[@]\"\nmydb \"$@\"\n\nThis shows a completion function for a command mydb which  takes\ntwo  command  arguments, add and show.  show takes no arguments,\nwhile the arguments for add have already been prepared in an ar-\nray   mydbaddcmds,  quite  possibly  by  a  previous  call  to\nregexwords.\n\nrequested [ -x ] [ -12VJ ] tag [ name descr [ command [ arg ... ] ]\nThis function is called to decide whether a tag  already  regis-\ntered  by  a call to tags (see below) has been requested by the\nuser and hence completion should be performed for  it.   It  re-\nturns  status  zero  if the tag is requested and non-zero other-\nwise.  The function is typically used as part  of  a  loop  over\ndifferent tags as follows:\n\ntags foo bar baz\nwhile tags; do\nif requested foo; then\n... # perform completion for foo\nfi\n... # test the tags bar and baz in the same way\n... # exit loop if matches were generated\ndone\n\nNote  that  the  test  for whether matches were generated is not\nperformed until the end of the tags loop.  This is so that  the\nuser  can set the tag-order style to specify a set of tags to be\ncompleted at the same time.\n\nIf name and descr are given, requested calls  the  description\nfunction  with  these arguments together with the options passed\nto requested.\n\nIf command is given, the alllabels function will be called im-\nmediately  with  the same arguments.  In simple cases this makes\nit possible to perform the test for the tag and the matching  in\none go.  For example:\n\nlocal expl ret=1\ntags foo bar baz\nwhile tags; do\nrequested foo expl 'description' \\\ncompadd foobar foobaz && ret=0\n...\n(( ret )) || break\ndone\n\nIf  the command is not compadd, it must nevertheless be prepared\nto handle the same options.\n\nretrievecache cacheidentifier\nThis function retrieves completion  information  from  the  file\ngiven  by  cacheidentifier,  stored in a directory specified by\nthe cache-path style which defaults to ~/.zcompcache.   The  re-\nturn  status  is zero if retrieval was successful.  It will only\nattempt retrieval if the use-cache style is set, so you can call\nthis  function without worrying about whether the user wanted to\nuse the caching layer.\n\nSee storecache below for more details.\n\nsepparts\nThis function is passed alternating arrays and separators as ar-\nguments.  The arrays specify completions for parts of strings to\nbe separated by the separators.  The arrays may be the names  of\narray  parameters or a quoted list of words in parentheses.  For\nexample, with the array `hosts=(ftp news)' the call  `sepparts\n'(foo  bar)' @ hosts' will complete the string  `f' to `foo' and\nthe string `b@n' to `bar@news'.\n\nThis function accepts the  compadd  options  `-V',  `-J',  `-1',\n`-2',  `-n',  `-X',  `-M',  `-P', `-S', `-r', `-R', and `-q' and\npasses them on to the compadd builtin used to add the matches.\n\nsequence [ -s sep ] [ -n max ] [ -d ] function [ - ] ...\nThis function is a wrapper to  other  functions  for  completing\nitems in a separated list. The same function is used to complete\neach item in the list. The separator is specified  with  the  -s\noption.  If  -s is omitted it will use `,'. Duplicate values are\nnot matched unless -d is specified. If there is a fixed or maxi-\nmum  number of items in the list, this can be specified with the\n-n option.\n\nCommon compadd options are passed on to the function. It is pos-\nsible to use compadd directly with sequence, though values may\nbe more appropriate in this situation.\n\nsetup tag [ group ]\nThis function sets up the special parameters used by the comple-\ntion  system  appropriately for the tag given as the first argu-\nment.    It   uses   the   styles   list-colors,    list-packed,\nlist-rows-first, last-prompt, accept-exact, menu and force-list.\n\nThe  optional  group supplies the name of the group in which the\nmatches will be placed.  If it is not given, the tag is used  as\nthe group name.\n\nThis  function  is  called  automatically  from description and\nhence is not normally called explicitly.\n\nstorecache cacheidentifier param ...\nThis function, together with retrievecache and cacheinvalid,\nimplements  a  caching layer which can be used in any completion\nfunction.  Data obtained by costly operations are stored in  pa-\nrameters;  this  function then dumps the values of those parame-\nters to a file.  The data can then  be  retrieved  quickly  from\nthat  file  via  retrievecache, even in different instances of\nthe shell.\n\nThe cacheidentifier specifies the file which the data should be\ndumped  to.   The file is stored in a directory specified by the\ncache-path style which defaults to ~/.zcompcache.  The remaining\nparams arguments are the parameters to dump to the file.\n\nThe  return status is zero if storage was successful.  The func-\ntion will only attempt storage if the use-cache style is set, so\nyou  can  call  this function without worrying about whether the\nuser wanted to use the caching layer.\n\nThe completion function may avoid calling  retrievecache  when\nit  already  has  the  completion  data available as parameters.\nHowever, in that case it should  call  cacheinvalid  to  check\nwhether  the  data  in the parameters and in the cache are still\nvalid.\n\nSee the perlmodules completion function for a  simple  example\nof the usage of the caching layer.\n\ntags [ [ -C name ] tag ... ]\nIf  called  with  arguments,  these are taken to be the names of\ntags valid for completions in the current context.   These  tags\nare stored internally and sorted by using the tag-order style.\n\nNext, tags is called repeatedly without arguments from the same\ncompletion function.  This successively selects the first,  sec-\nond,  etc. set of tags requested by the user.  The return status\nis zero if at least one of the tags is  requested  and  non-zero\notherwise.  To test if a particular tag is to be tried, the re-\nquested function should be called (see above).\n\nIf `-C name' is given, name is temporarily stored in  the  argu-\nment  field (the fifth) of the context in the curcontext parame-\nter during the call to tags; the field  is  restored  on  exit.\nThis  allows tags to use a more specific context without having\nto change and reset the curcontext parameter (which has the same\neffect).\n\ntildefiles\nLike  files,  but resolve leading tildes according to the rules\nof filename expansion, so the suggested completions don't  start\nwith a `~' even if the filename on the command-line does.\n\nvalues [ -O name ] [ -s sep ] [ -S sep ] [ -wC ] desc spec ...\nThis  is  used to complete arbitrary keywords (values) and their\narguments, or lists of such combinations.\n\nIf the first argument is the option `-O name', it will  be  used\nin  the same way as by the arguments function.  In other words,\nthe elements of the name array will be passed  to  compadd  when\nexecuting an action.\n\nIf the first argument (or the first argument after `-O name') is\n`-s', the next argument is used as the character that  separates\nmultiple  values.   This  character is automatically added after\neach value in an auto-removable fashion (see below); all  values\ncompleted by `values -s' appear in the same word on the command\nline, unlike completion using arguments.  If this option is not\npresent, only a single value will be completed per word.\n\nNormally,  values  will  only use the current word to determine\nwhich values are already present on the command line  and  hence\nare not to be completed again.  If the -w option is given, other\narguments are examined as well.\n\nThe first non-option argument, desc, is  used  as  a  string  to\nprint as a description before listing the values.\n\nAll other arguments describe the possible values and their argu-\nments in the same format used for the description of options  by\nthe  arguments  function (see above).  The only differences are\nthat no minus or plus sign is required at the beginning,  values\ncan  have  only  one argument, and the forms of action beginning\nwith an equal sign are not supported.\n\nThe character separating a value from its argument  can  be  set\nusing  the  option -S (like -s, followed by the character to use\nas the separator in the next argument).  By default  the  equals\nsign will be used as the separator between values and arguments.\n\nExample:\n\nvalues -s , 'description' \\\n'*foo[bar]' \\\n'(two)*one[number]:first count:' \\\n'two[another number]::second count:(1 2 3)'\n\nThis  describes  three possible values: `foo', `one', and `two'.\nThe first is described as `bar', takes no argument and  may  ap-\npear  more  than once.  The second is described as `number', may\nappear more than once, and  takes  one  mandatory  argument  de-\nscribed as `first count'; no action is specified, so it will not\nbe completed.  The `(two)' at the beginning  says  that  if  the\nvalue  `one'  is  on the line, the value `two' will no longer be\nconsidered a  possible  completion.   Finally,  the  last  value\n(`two')  is  described as `another number' and takes an optional\nargument described as `second count' for which  the  completions\n(to  appear  after  an  `=') are `1', `2', and `3'.  The values\nfunction will complete lists of these values separated  by  com-\nmas.\n\nLike  arguments, this function temporarily adds another context\nname component to the arguments element (the fifth) of the  cur-\nrent context while executing the action.  Here this name is just\nthe name of the value for which the argument is completed.\n\nThe style verbose is used to decide if the descriptions for  the\nvalues (but not those for the arguments) should be printed.\n\nThe  associative  array  valargs  is  used to report values and\ntheir arguments; this works similarly to the  optargs  associa-\ntive array used by arguments.  Hence the function calling val-\nues should declare  the  local  parameters  state,  statedescr,\nline, context and valargs:\n\nlocal context state statedescr line\ntypeset -A valargs\n\nwhen using an action of the form `->string'.  With this function\nthe context parameter will be set to the name of the value whose\nargument  is  to be completed.  Note that for values, the state\nand statedescr are scalars rather than arrays.  Only  a  single\nmatching state is returned.\n\nNote  also  that values normally adds the character used as the\nseparator between values as an auto-removable suffix (similar to\na  `/'  after a directory).  However, this is not possible for a\n`->string' action as the matches for the argument are  generated\nby  the calling function.  To get the usual behaviour, the call-\ning function can add the separator x as a suffix by passing  the\noptions `-qS x' either directly or indirectly to compadd.\n\nThe option -C is treated in the same way as it is by arguments.\nIn that case the parameter curcontext should be made  local  in-\nstead of context (as described above).\n\nwanted [ -x ] [ -C name ]  [ -12VJ ] tag name descr command [ arg ...]\nIn  many  contexts,  completion can only generate one particular\nset of matches, usually corresponding to a single tag.  However,\nit  is  still  necessary  to  decide  whether  the user requires\nmatches of this type.  This function is useful in such a case.\n\nThe arguments to wanted are the same as  those  to  requested,\ni.e.  arguments  to be passed to description.  However, in this\ncase the command is not optional;  all the processing  of  tags,\nincluding the loop over both tags and tag labels and the genera-\ntion of matches, is carried out automatically by wanted.\n\nHence to offer only one tag and immediately add the  correspond-\ning matches with the given description:\n\nlocal expl\nwanted tag expl 'description' \\\ncompadd matches...\n\nNote that, as for requested, the command must be able to accept\noptions to be passed down to compadd.\n\nLike tags this function supports the -C option to give  a  dif-\nferent  name  for the argument context field.  The -x option has\nthe same meaning as for description.\n\nwidgets [ -g pattern ]\nThis function completes names of zle widgets  (see  the  section\n`Widgets'  in  zshzle(1)).   The pattern, if present, is matched\nagainst values of the $widgets special parameter, documented  in\nthe section `The zsh/zleparameter Module' in zshmodules(1).\n",
            "subsections": []
        },
        "COMPLETION SYSTEM VARIABLES": {
            "content": "There  are  some  standard variables, initialised by the maincomplete\nfunction and then used from other functions.\n\nThe standard variables are:\n\ncompcalleroptions\nThe completion system uses setopt to set a  number  of  options.\nThis allows functions to be written without concern for compati-\nbility with every possible combination of user options. However,\nsometimes  completion needs to know what the user's option pref-\nerences are. These are saved in the  compcalleroptions  asso-\nciative array. Option names, spelled in lowercase without under-\nscores, are mapped to one or  other  of  the  strings  `on'  and\n`off'.\n\ncompprivprefix\nCompletion   functions   such   as   sudo  can  set  the\ncompprivprefix array to a command prefix that may then\nbe  used  by  callprogram  to match the privileges when\ncalling programs to generate matches.\n\nTwo more features are offered by  the  maincomplete  function.\nThe  arrays  compprefuncs and comppostfuncs may contain names of\nfunctions that are to be called immediately before or after com-\npletion has been tried.  A function will only be called once un-\nless it explicitly reinserts itself into the array.\n",
            "subsections": []
        },
        "COMPLETION DIRECTORIES": {
            "content": "In the source distribution, the files are contained in  various  subdi-\nrectories of the Completion directory.  They may have been installed in\nthe same structure, or into one single function directory.  The follow-\ning  is  a  description  of  the  files found in the original directory\nstructure.  If you wish to alter an installed file, you  will  need  to\ncopy  it to some directory which appears earlier in your fpath than the\nstandard directory where it appears.\n\nBase   The core functions and special completion widgets  automatically\nbound  to  keys.   You will certainly need most of these, though\nwill probably not need to alter them.  Many of these  are  docu-\nmented above.\n\nZsh    Functions for completing arguments of shell builtin commands and\nutility functions for this.  Some of  these  are  also  used  by\nfunctions from the Unix directory.\n\nUnix   Functions  for  completing  arguments  of  external commands and\nsuites of commands.  They may need modifying  for  your  system,\nalthough in many cases some attempt is made to decide which ver-\nsion of a command is present.  For example, completion  for  the\nmount  command  tries  to determine the system it is running on,\nwhile completion for many other utilities try to decide  whether\nthe  GNU version of the command is in use, and hence whether the\n--help option is supported.\n\nX, AIX, BSD, ...\nCompletion and utility function for commands available  only  on\nsome  systems.   These  are not arranged hierarchically, so, for\nexample, both the Linux and Debian directories, as well as the X\ndirectory, may be useful on your system.\n\nzsh 5.8.1                      February 12, 2022                 ZSHCOMPSYS(1)",
            "subsections": []
        }
    },
    "summary": "zshcompsys - zsh completion system",
    "flags": [],
    "examples": [],
    "see_also": []
}