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

Re: [PATCH v4] zsh localedef completion



Two minor things about this


> +      "(-u)"-u+'[specify target codeset]:codeset:_files'
> +    )
> +  [[ $OSTYPE == (freebsd*|dragonfly*) ]] && bsd_opts=(
> +      "(-D)"-D'[create BSD-style output]' \
> +      "(-U)"-U'[ignore undefined character symbols]' \
> +      "(-v)"-v'[verbose deguggin output]' \
> +      "(-w)"-w+'[specify width file]:width file:_files' \
> +    )
> +
> +  _arguments -A "-*" -C \
> +    "(-c)"-c'[force write despite of warnings]' \
> +    "(-f)"-f+'[specify locale charmap file]:charmap:->charmap' \
> +    "(-i)"-i+'[specify locale definition file]:locale file:_files' \

You don't have to specify the option itself in the exclusion list of the optspec,
compsys only completes an option once (normally).

A person normally includes the option in the exclusion list with a trick like
"(-v --verbose $exargs)"{-v,--verbose}'[display additional information]'

Because brace expansion will expand into two (shell) words
(-v --verbose $exargs)--verbose[display additional information] # and
(-v --verbose $exargs)-v[display additional information]

Which saves a bit of typing.


> +        _wanted values expl charmap compadd "$@" \
> +          -M 'm:{a-zA-Z}={A-Za-z} r:|-=* r:|=*' \
> +          -a - charmaps && ret=0


Also, what is the list's opinion of an completer forcing case insensitivity?
Its a option the user normally have control over but after checking Completion/,
i notice a few non-utility functions also do so.

Some examples being _git, _imagemagick, _graphicsmagick, _mtools, _whois
_mozilla, _netscape



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