zsh-workers
 help / color / mirror / code / Atom feed
From: Clint Adams <schizo@debian.org>
To: ralph.amissah@gmail.com
Cc: zsh-workers@sunsite.dk
Subject: Re: zsh completion for sisu
Date: Sun, 20 Aug 2006 23:51:27 -0400	[thread overview]
Message-ID: <20060821035127.GA4986@scowler.net> (raw)
In-Reply-To: <20060819114356.GA14042@amissah.com>

[Cc:ing zsh-workers so others can jump in here]

> #compdef sisu
> # Copyright (C) 2006 Ralph Amissah
> # sisu, version 0.46.1
> # same license as Zsh or SiSU

In the following lines, you are unconditionally setting zstyles
globally.  This is inadvisable as it will override user settings
and interfere with other completion functions.  If you need to set
them, you should probably only set the zstyles for something like
':completion:*:complete:sisu:*', and only if the user hasn't set them.
Without knowing anything about how sisu command-line arguments work,
I'd assume that you don't really need to set these.

> zstyle ':completion:*' tag-order \
>  'options:-long:long\ options
>   options:-short:short\ options
>   options:-single-letter:single\ letter\ options'
> zstyle ':completion:*:options-long' ignored-patterns '[-+](|-|[^-]*)'
> zstyle ':completion:*:options-short' ignored-patterns '--*' '[-+]?'
> zstyle ':completion:*:options-single-letter' ignored-patterns '???*'
> #
> zstyle ':completion:*' completer _complete _correct
> ## matcher
> ##Another use of patterns is to try multiple match specifications one after another
> zstyle ':completion:*:*:foo:*' tag-order '*' '*:-case'
> zstyle ':completion:*-case' matcher 'm:{a-z}={A-Z}'

For example, you may want to use the -M option to _arguments instead.

> # is possible to use the -e option of the zstyle builtin command to specify conditions for the use of particular tags. For example:
> zstyle -e '*:-command-:*' tag-order '
>     if [[ -n $PREFIX$SUFFIX ]]; then
>       reply=( )
>     else
>       reply=( - )
>     fi'
> 
> local curcontext="$curcontext" state line ret=1
> typeset -A opt_args
> _arguments -s -C \
>   '--no-ocn[-\[hHp\]switches off object citation numbering]' \
>   '--no-annotate[-\[mhHpoxXabN\] strips output text of additional editors endnotes]' \
>   '(--convert --to -C)-A[plaintext with dos line-feeds, footnotes follow paragraphs in which they occur]' \
>   '(--convert --to -C)-a[plaintext with Unix line-feeds, footnotes follow paragraphs in which they occur]' \
>   '(--convert --to -C)-b[XHTML output]' \
>   '(- *)-C[initialise site]' \
>   '(--convert --to -C)-c[toggle screen color on or off depending on set default]' \
>   '(--convert --to -C)-D[postgresql database instruction]' \
>   '(--convert --to -C)-d[sqlite database instruction]' \
>   '(--convert --to -C)-E[plaintext with dos line-feeds, endnotes following main text]' \
>   '(--convert --to -C)-e[plaintext with Unix line-feeds, endnotes following main text]' \
>   '(--convert --to -C)-F[generate sample cgi web search form \[--webserv=webrick for sisu webrick url\]]' \
>   '(--convert --to -C -h)-H[HTML output, without link suffixes]' \
>   '(--convert --to -C -H)-h[HTML output]' \
>   '(--convert --to -C)-I[texinfo output, not maintained]' \
>   '(--convert --to -C)-L[print license info]' \
>   '(--convert --to -C)-M[maintenance mode, retain intermediate processing files]' \
>   '(--convert --to -C)-m[create intermediate markup file, metaverse, assumed for most output instuctions]' \
>   '(--convert --to -C)-N[document content certificate, output document digests]' \
>   '(--convert --to -C)-n[skip intermediate markup, skip -m]' \
>   '(--convert --to -C)-o[Open Document text format output]' \
>   '(--convert --to -C)-p[LaTeX pdf output]' \
>   '(--convert --to -C)-q[quiet mode]' \
>   '(--convert --to -C)-R[post output to remote host using rsync, requires pre-configuration]' \
>   '(--convert --to -C)-r[post output to remote host using scp, requires pre-configuration]' \
>   '(--convert --to -C)-S[produces and shares tarred gzipped markup source document with associated images etc.]' \
>   '(--convert --to -C)-s[shares markup source]' \
>   '(--convert --to -C)-t[termsheet, preprocessing]' \
>   '(--convert --to -C)-U[prints to screen url output map of available output possibilities]' \
>   '(--convert --to -C)-u[url mapping of output files for requested processing flags]' \
>   '(--convert --to -C)-V[more verbose than -v]' \
>   '(--convert --to -C)-v[verbose]' \
>   '(- *)-W[starts ruby webrick server]' \
>   '(--convert --to -C)-w[concordance file]' \
>   '(--convert --to -C)-X[XML dom style]' \
>   '(--convert --to -C)-x[XML sax style]' \
>   '(--convert --to -C)-y[output summary page, manifest of existing generated output]' \
>   '(--convert --to -C)-Z[Zap delete/destroy output]' \
>   '(--convert --to -C -2 -3 -4 -5)-1[shortcut, initial default -mNHwpy]' \
>   '(--convert --to -C -1 -3 -4 -5)-2[shortcut, initial default -mNHwpaoy]' \
>   '(--convert --to -C -1 -2 -4 -5)-3[shortcut, initial default -mNHwpaobxXy]' \
>   '(--convert --to -C -1 -2 -3 -5)-4[shortcut, initial default -mNHwpaobxXDy --import]' \
>   '(--convert --to -C -1 -2 -3 -4)-5[shortcut, initial default -mNHwpaobxXDy --update]' \
>   '--to=node[XML node based input representation, experimental]' \
>   '--to=sax[XML sax based input representation, experimental]' \
>   '--to=dom[XML dom based input representation, experimental]' \
>   '--convert=footnotes[embedded footnotes]' \
>   '--to=current[current markup]' \
>   '--import[-\[Dd\] imports document to database]' \
>   '--update[-\[Dd\] updates document in database]' \
>   '--remove[-\[Dd\] removes document from database]' \
>   '--dropall[-\[Dd\] drops database, tables, indexes, all!]' \
>   '--create[-\[Dd\] creates new database - tables, indexes, etc.]' \
>   '--recreate[-\[Dd\] drops database, killing data and creates new empty database - tables, indexes, etc.]' \
>   '(- *)--help[display help information]'
> 
> _files -g '*.(sst|ssm)(.)'

Probably you want to tack the _files onto the _arguments call, like this
  '(- *)--help[display help information]' \
  ':SiSU files:_files -g "*.(sst|ssm)"'

or

  '(- *)--help[display help information]' \
  '*:SiSU files:_files -g "*.(sst|ssm)"'

> #'--no-asterisk[-\[mhHpoxXabN\] strips output of editors asterisk endnotes]' \
> #'--no-dagger[-\[mhHpoxXabN\] strips output of editors dagger endnotes]' \
> 
> #'--no-asterisk[-\[mhHpoxXabN\] strips output of editors asterisk endnotes]' \
> #'--no-dagger[-\[mhHpoxXabN\] strips output of editors dagger endnotes]' \


       reply	other threads:[~2006-08-21  3:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20060819114356.GA14042@amissah.com>
2006-08-21  3:51 ` Clint Adams [this message]
2006-08-21 12:22 ralph.amissah

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060821035127.GA4986@scowler.net \
    --to=schizo@debian.org \
    --cc=ralph.amissah@gmail.com \
    --cc=zsh-workers@sunsite.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).