From 346825df86466cf151be61b9429ef2c1734e66ea Mon Sep 17 00:00:00 2001 From: Tanaka Akira Date: Sun, 27 Jun 1999 05:33:04 +0000 Subject: zsh-3.1.5-pws-24 --- Completion/User/.distfiles | 6 +++--- Completion/User/_chown | 15 +++++++++++++++ Completion/User/_dd | 5 ++--- Completion/User/_find | 6 +++--- Completion/User/_groups | 6 ++++++ Completion/User/_make | 24 ++++++++++++++++++++++-- Completion/User/_mh | 6 +++--- Completion/User/_rlogin | 2 +- Completion/User/_x_options | 6 +++++- 9 files changed, 60 insertions(+), 16 deletions(-) create mode 100644 Completion/User/_chown create mode 100644 Completion/User/_groups (limited to 'Completion/User') diff --git a/Completion/User/.distfiles b/Completion/User/.distfiles index ee0017035..07fddc134 100644 --- a/Completion/User/.distfiles +++ b/Completion/User/.distfiles @@ -1,6 +1,6 @@ DISTFILES_SRC=' .distfiles - _a2ps _compress _configure _dd _dvi _find _gunzip _gzip _hosts - _make _man _mh _pdf _ps _rcs _rlogin _strip _stty _tar _tar_archive - _tex _uncompress _x_options _xfig + _a2ps _chown _compress _configure _dd _dvi _find _groups _gunzip _gzip + _hosts _make _man _mh _pdf _ps _rcs _rlogin _strip _stty + _tar _tar_archive _tex _uncompress _x_options _xfig ' diff --git a/Completion/User/_chown b/Completion/User/_chown new file mode 100644 index 000000000..1ec76b39e --- /dev/null +++ b/Completion/User/_chown @@ -0,0 +1,15 @@ +#compdef chown chgrp + +if [[ CURRENT -eq 2 || CURRENT -eq 3 && $words[CURRENT-1] = -* ]]; then + if [[ $words[1] = chgrp ]] || compset -P '*[:.]'; then + _groups + else + if [[ $OSTYPE = (solaris*|hpux*) ]]; then + compgen -u -S ':' -q + else + compgen -u -S '.' -q + fi + fi +else + _files +fi diff --git a/Completion/User/_dd b/Completion/User/_dd index 6094d60b7..e57074520 100644 --- a/Completion/User/_dd +++ b/Completion/User/_dd @@ -4,10 +4,9 @@ if compset -P 1 'conv\='; then # If there's a comma present, ignore up to the last one. The # test alone will have that effect. compset -p '*,' - compgen -S, -q \ - -k '(ascii ebcdic ibm block unblock lcase ucase swab noerror sync)' + compadd -qS, -q ascii ebcdic ibm block unblock lcase ucase swab noerror sync elif compset -P 1 '[io]f\='; then _files else - compgen -S '=' -k '(if of ibs obs bs cbs skip files seek count conv)' + compadd -S '=' if of ibs obs bs cbs skip files seek count conv fi diff --git a/Completion/User/_find b/Completion/User/_find index dd00b0ed1..de8c3bff9 100644 --- a/Completion/User/_find +++ b/Completion/User/_find @@ -5,10 +5,10 @@ local prev="$words[CURRENT-1]" if compset -N '-(ok|exec)' '\;'; then _normal elif compset -P 1 -; then - compgen -s 'daystart {max,min,}depth follow noleaf version xdev \ + compadd daystart {max,min,}depth follow noleaf version xdev \ {a,c,}newer {a,c,m}{min,time} empty false {fs,x,}type gid inum links \ {i,}{l,}name {no,}{user,group} path perm regex size true uid used \ - exec {f,}print{f,0,} ok prune ls' + exec {f,}print{f,0,} ok prune ls elif [[ CURRENT -eq 2 ]]; then local ret=1 @@ -19,7 +19,7 @@ elif [[ CURRENT -eq 2 ]]; then elif [[ "$prev" = -((a|c|)newer|fprint(|0|f)) ]]; then _files elif [[ "$prev" = -fstype ]]; then - compgen -k '(ufs 4.2 4.3 nfs tmp mfs S51K S52K)' + compadd ufs 4.2 4.3 nfs tmp mfs S51K S52K elif [[ "$prev" = -group ]]; then compgen -k groups elif [[ "$prev" = -user ]]; then diff --git a/Completion/User/_groups b/Completion/User/_groups new file mode 100644 index 000000000..975189174 --- /dev/null +++ b/Completion/User/_groups @@ -0,0 +1,6 @@ +#compdef newgrp + +: ${(A)groups:=${${(s: :)$(/dev/null | awk -F: '\''{ print $1 }'\'')' && + compadd $(mark $foldnam 2>/dev/null | awk -F: '{ print $1 }') && ret=0 compadd reply next cur prev first last all unseen && ret=0 compgen -W folddir -g '<->' && ret=0 diff --git a/Completion/User/_rlogin b/Completion/User/_rlogin index 9f5f3d628..b792ba0d1 100644 --- a/Completion/User/_rlogin +++ b/Completion/User/_rlogin @@ -3,7 +3,7 @@ if [[ CURRENT -eq 2 ]]; then compgen -k hosts elif [[ CURRENT -eq 3 ]]; then - compgen -k '(-l)' + compadd - -l else compgen -u fi diff --git a/Completion/User/_x_options b/Completion/User/_x_options index cd45c87f6..a9c18b0d1 100644 --- a/Completion/User/_x_options +++ b/Completion/User/_x_options @@ -2,4 +2,8 @@ # A simple pattern completion, just as an example. -compgen -J options -k '(-display -name -xrm)' +if [ "$words[CURRENT-1]" = "-display" ]; then + compgen -k hosts -S':0' +else + compadd -J options - -display -name -xrm +fi -- cgit 1.4.1