summaryrefslogtreecommitdiffstats
path: root/Misc/lete2ctl
diff options
context:
space:
mode:
authorTanaka Akira <akr@users.sourceforge.net>1999-04-15 18:09:05 +0000
committerTanaka Akira <akr@users.sourceforge.net>1999-04-15 18:09:05 +0000
commit9003d99d16c46b5679da7fcf1f2a41adef495ff9 (patch)
tree95244be534cc37c03a628068faf7712da6317196 /Misc/lete2ctl
parentzsh-3.1.5-pws-2 (diff)
downloadzsh-9003d99d16c46b5679da7fcf1f2a41adef495ff9.tar
zsh-9003d99d16c46b5679da7fcf1f2a41adef495ff9.tar.gz
zsh-9003d99d16c46b5679da7fcf1f2a41adef495ff9.tar.bz2
zsh-9003d99d16c46b5679da7fcf1f2a41adef495ff9.tar.lz
zsh-9003d99d16c46b5679da7fcf1f2a41adef495ff9.tar.xz
zsh-9003d99d16c46b5679da7fcf1f2a41adef495ff9.tar.zst
zsh-9003d99d16c46b5679da7fcf1f2a41adef495ff9.zip
zsh-3.1.5-pws-3zsh-3.1.5-pws-3
Diffstat (limited to 'Misc/lete2ctl')
-rwxr-xr-xMisc/lete2ctl49
1 files changed, 5 insertions, 44 deletions
diff --git a/Misc/lete2ctl b/Misc/lete2ctl
index 273ea4674..ca00b8aee 100755
--- a/Misc/lete2ctl
+++ b/Misc/lete2ctl
@@ -9,7 +9,6 @@
# Runs as a filter. Should ignore anything which isn't a "complete".
# It expects each "complete" statement to be the first thing on a line.
# All the examples in the tcsh manual give sensible results.
-# Author: Peter Stephenson <pws@ibmth.df.unipi.it>
#
# Option:
# -x (exact): only applies in the case of command disambiguation (is
@@ -39,11 +38,6 @@
# (5) Make sure all command names with wildcards are processed together --
# they need to be lumped into one "compctl -C" or "compctl -D"
# statement for zsh.
-# (6) Group completion (complete's g flag) is not built into zsh, so
-# you need perl to be available to generate the groups. If this
-# script is useful, I assume that's not a problem.
-# (7) I don't know what `completing completions' means, so the X
-# flag to complete is not handled.
# Handle options
if (@ARGV) {
@@ -119,13 +113,6 @@ sub gettype {
# Nothing (n) can be handled by returning nothing. (C.f. King Lear, I.i.)
if ($c =~ /[abcjuv]/) {
$ret = "-$c";
- } elsif ($c eq 'C') {
- if (defined($glob)) {
- $ret = "-W $glob -/g '*(.*)'";
- undef($glob);
- } else {
- $ret = '-c';
- }
} elsif ($c eq 'S') {
$ret = '-k signals';
} elsif ($c eq 'd') {
@@ -134,42 +121,18 @@ sub gettype {
} else {
$ret = '-/';
}
- } elsif ($c eq 'D') {
- if (defined($glob)) {
- $ret = "-W $glob -/";
- undef($glob);
- } else {
- $ret = '-/';
- }
} elsif ($c eq 'e') {
$ret = '-E';
} elsif ($c eq 'f' && !$glob) {
$ret = '-f';
- } elsif ($c eq 'F') {
- if (defined($glob)) {
- $ret = "-W $glob -f";
- undef($glob);
- } else {
- $ret = '-f';
- }
- } elsif ($c eq 'g') {
- $ret = "-s '\$(perl -e '\\''while ((\$name) = getgrent)\n" .
- "{ print \$name, \"\\n\"; }'\\'')'";
} elsif ($c eq 'l') {
$ret = q!-k "(`limit | awk '{print $1}'`)"!;
} elsif ($c eq 'p') {
- $ret = "-W $glob -f", undef($glob) if defined($glob);
+ $ret = "-W $glob -f", undef($glob) if defined($glob);
} elsif ($c eq 's') {
- $ret = '-p';
+ $ret = '-p';
} elsif ($c eq 't') {
$qual = '.';
- } elsif ($c eq 'T') {
- if (defined($glob)) {
- $ret = "-W $glob -g '*(.)'";
- undef($glob);
- } else {
- $ret = "-g '*(.)'";
- }
} elsif ($c eq 'x') {
$glob =~ s/'/'\\''/g;
$ret = "-X '$glob'";
@@ -227,7 +190,7 @@ $" = " - ";
while (<>) {
if (/^\s*complete\s/) {
- undef(@stuff);
+ undef(@stuff);
$default = '';
$_ = $';
while (/\\$/) {
@@ -248,7 +211,7 @@ while (<>) {
# Loop over remaining arguments to "complete".
$sep = substr($word,1,1);
$sep =~ s/(\W)/\\$1/g;
- @split = split(/$sep/,$word,4);
+ @split = split(/$sep/,$word);
for ($i = 0; $i < 3; $i++) {
while ($split[$i] =~ /\\$/) {
substr($split[$i],-1,1) = "";
@@ -262,9 +225,7 @@ while (<>) {
# The "complete" catch-all: treat this as compctl\'s
# default (requiring no pattern matching).
$default .= &gettype($type) . ' ';
- defined($suffix) &&
- (defined($defsuf) ? ($defsuf .= $suffix)
- : ($defsuf = $suffix));
+ defined($suffix) && ($defsuf .= $suffix);
} else {
$pat = &getpat($pat,$arg);
$type = &gettype($type);