zsh-workers
 help / color / mirror / code / Atom feed
From: Sven Wischnowsky <wischnow@informatik.hu-berlin.de>
To: zsh-workers@sunsite.auc.dk
Subject: bash-2.04 programmable completion
Date: Fri, 26 Nov 1999 12:38:28 +0100 (MET)	[thread overview]
Message-ID: <199911261138.MAA14654@beta.informatik.hu-berlin.de> (raw)


Just found this:

> From: chet@nike.ins.cwru.edu (Chet Ramey)
> Subject: Bash-2.04 Programmable Completion message 4
> Date: 05 Nov 1999 00:00:00 GMT
> Message-ID: <991105173103.AA78566.SM@nike.ins.cwru.edu>
> ...
> Newsgroups: gnu.bash.bug

Some excerpts:

> ...
> # this isn't exactly right yet -- needs to skip shell functions and
> # do $PATH lookup (or do compgen -c and filter out matches that also
> # appear in compgen -A function)
> complete -c command
> 
> # could add -S '=', but that currently screws up because readline appends
> # a space unconditionally
> 
> complete -v export local readonly
> ...
> #
> # Job control builtins: fg, bg, disown, kill, wait
> # kill not done yet
> #
> 
> complete -A stopped -P '%' bg
> complete -j -P '%' fg jobs disown
> ...
> #
> # meta-completion (completion for complete/compgen)
> #
> _complete_meta_func()
> {
>         local cur prev cmd
>         COMPREPLY=()
> 
>         cmd=$1
> 
>         cur=${COMP_WORDS[COMP_CWORD]}
>         prev=${COMP_WORDS[COMP_CWORD-1]}
> 
>         if (( $COMP_CWORD <= 1 )) || [[ "$cur" == '-' ]]; then
>                 case "$cmd" in
>                 complete) COMPREPLY=(-a -b -c -d -e -f -j -k -v -u -r -p -A -G -W -P -S -X -F -C);;
>                 compgen)  COMPREPLY=(-a -b -c -d -e -f -j -k -v -u -A -G -W -P -S -X -F -C);;
>                 esac
>                 return 0
>         fi
> 
>         if [[ $prev == -A ]]; then
>                 COMPREPLY=(alias arrayvar binding builtin command directory \
> disabled enabled export file function helptopic hostname job keyword \
> running setopt shopt signal stopped variable)
>                 return 0
>         elif [[ $prev == -F ]]; then
>                 COMPREPLY=( $( compgen -A function $cur ) )
>         elif [[ $prev == -C ]]; then
>                 COMPREPLY=( $( compgen -c $cur ) )
>         else
>                 COMPREPLY=( $( compgen -c $cur ) )
>         fi
>         return 0
> }
> complete -F _complete_meta_func complete compgen
> ...
> complete -f chown ln more cat
> complete -d mkdir rmdir
> ...
> complete -f -X '!*.pl' perl perl5
> 
> complete -A hostname rsh telnet rlogin ftp ping xping host traceroute nslookup
> ...
> complete -u su

Two builtins `complete' and `compgen' with almost the same options,
functions starting with underscore, -[PS] options, COMPREPLY, arrays
holding names of stopped jobs and functions, etc.

`compgen' is lightly different from what was our `compgen', it
obviously just outputs the possible matches. But then -- the name.

Are we being monitored? ;-)

Unfortunately I couldn't any more info...

Bye
 Sven


--
Sven Wischnowsky                         wischnow@informatik.hu-berlin.de


             reply	other threads:[~1999-11-26 11:38 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-11-26 11:38 Sven Wischnowsky [this message]
1999-11-29 17:53 ` Falk Hueffner
1999-11-30  9:03 Sven Wischnowsky
1999-11-30 12:41 ` Adam Spiers
1999-11-30 14:50   ` Clint Adams

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=199911261138.MAA14654@beta.informatik.hu-berlin.de \
    --to=wischnow@informatik.hu-berlin.de \
    --cc=zsh-workers@sunsite.auc.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).