summary refs log tree commit diff
path: root/Completion/User
diff options
context:
space:
mode:
Diffstat (limited to 'Completion/User')
-rw-r--r--Completion/User/.distfiles6
-rw-r--r--Completion/User/_a2ps22
-rw-r--r--Completion/User/_compress3
-rw-r--r--Completion/User/_configure12
-rw-r--r--Completion/User/_dd13
-rw-r--r--Completion/User/_dvi3
-rw-r--r--Completion/User/_find21
-rw-r--r--Completion/User/_gunzip3
-rw-r--r--Completion/User/_gzip3
-rw-r--r--Completion/User/_hosts3
-rw-r--r--Completion/User/_make3
-rw-r--r--Completion/User/_man11
-rw-r--r--Completion/User/_mh70
-rw-r--r--Completion/User/_pdf3
-rw-r--r--Completion/User/_ps3
-rw-r--r--Completion/User/_rcs9
-rw-r--r--Completion/User/_rlogin9
-rw-r--r--Completion/User/_strip2
-rw-r--r--Completion/User/_stty16
-rw-r--r--Completion/User/_tar11
-rw-r--r--Completion/User/_tar_archive20
-rw-r--r--Completion/User/_tex3
-rw-r--r--Completion/User/_uncompress3
-rw-r--r--Completion/User/_x_options5
-rw-r--r--Completion/User/_xfig3
25 files changed, 260 insertions, 0 deletions
diff --git a/Completion/User/.distfiles b/Completion/User/.distfiles
new file mode 100644
index 000000000..ee0017035
--- /dev/null
+++ b/Completion/User/.distfiles
@@ -0,0 +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 
+'
diff --git a/Completion/User/_a2ps b/Completion/User/_a2ps
new file mode 100644
index 000000000..9aa9d3d99
--- /dev/null
+++ b/Completion/User/_a2ps
@@ -0,0 +1,22 @@
+#defcomp a2ps
+
+if [[ -prefix -- ]]; then
+  _comp_parts '(--borders --compact --truncate-lines --interpret
+                --print-anyway --delegate)' '=' '(yes no)'
+  _comp_parts '(--major)' '=' '(rows columns)'
+  _comp_parts '(--end-of-line)' '=' '(r n nr rn any)'
+
+  complist -S= -k '(--medium --columns --rows --line-numbers
+                    --font-size --lines-per-page --chars-per-line
+ 		    --tabsize --non-printable-format --encoding
+		    --title --stdin --prologue --highlight-level
+		    --strip-level --output --version-control --suffix
+		    --printer --copies --sides --page-prefeed
+		    --no-page-prefeed)'
+  complist -qS= -k '(--margin --header --underlay --left-title
+                     --right-title --left-footer --footer --right-footer
+		     --pages --pretty-print)'
+  complist -k '(--landscape --portrait --catman --no-header)'
+else
+  _files -F fignore -g "*~*.ps"
+fi
diff --git a/Completion/User/_compress b/Completion/User/_compress
new file mode 100644
index 000000000..860aeb5b0
--- /dev/null
+++ b/Completion/User/_compress
@@ -0,0 +1,3 @@
+#defcomp compress
+
+_files -g '*~*.Z'
diff --git a/Completion/User/_configure b/Completion/User/_configure
new file mode 100644
index 000000000..de8d5fba5
--- /dev/null
+++ b/Completion/User/_configure
@@ -0,0 +1,12 @@
+#defcomp configure
+
+if [[ $PREFIX = *=* ]]; then
+  # Complete filenames after e.g. --prefix=
+  IPREFIX=${PREFIX%%=*}=
+  PREFIX=${PREFIX#*=}
+  complist -f
+else
+  # Generate a list of options from configure --help
+  complist -s '$($COMMAND --help |
+  sed -n -e '\''s/^ *\(--[-a-z0-9]*\)[    =,].*$/\1/p'\'')'
+fi
diff --git a/Completion/User/_dd b/Completion/User/_dd
new file mode 100644
index 000000000..2458541ea
--- /dev/null
+++ b/Completion/User/_dd
@@ -0,0 +1,13 @@
+#defcomp dd
+
+if [[ -iprefix conv= ]]; then
+  # If there's a comma present, ignore up to the last one.  The
+  # test alone will have that effect.
+  [[ -string , ]]
+  complist -S, -q \
+  -k '(ascii ebcdic ibm block unblock lcase ucase swab noerror sync)'
+elif [[ -iprefix 'if=' || -iprefix 'of=' ]]; then
+  _files
+else
+  complist -S '=' -k '(if of ibs obs bs cbs skip files seek count conv)'
+fi
diff --git a/Completion/User/_dvi b/Completion/User/_dvi
new file mode 100644
index 000000000..bb2fc293e
--- /dev/null
+++ b/Completion/User/_dvi
@@ -0,0 +1,3 @@
+#defcomp xdvi dvips dvibook dviconcat dvicopy dvidvi dviselect dvitodvi dvitype
+
+_files -g '*.(dvi|DVI)'
diff --git a/Completion/User/_find b/Completion/User/_find
new file mode 100644
index 000000000..ca4f79908
--- /dev/null
+++ b/Completion/User/_find
@@ -0,0 +1,21 @@
+#defcomp find
+
+if [[ -mbetween -(ok|exec) \\\; ]]; then
+  _normal "$@"
+elif [[ -iprefix - ]]; then
+  complist -s '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'
+elif [[ -position 1 ]]; then
+  complist -g '. ..'
+  _files -g '(-/)'
+elif [[ -mcurrent -1 -((a|c|)newer|fprint(|0|f)) ]]; then
+  _files
+elif [[ -current -1 -fstype ]]; then
+  complist -k '(ufs 4.2 4.3 nfs tmp mfs S51K S52K)'
+elif [[ -current -1 -group ]]; then
+  complist -k groups
+elif [[ -current -1 -user ]]; then
+  complist -u
+fi
diff --git a/Completion/User/_gunzip b/Completion/User/_gunzip
new file mode 100644
index 000000000..35a27e774
--- /dev/null
+++ b/Completion/User/_gunzip
@@ -0,0 +1,3 @@
+#defcomp gunzip zcat
+
+_files -g '*.[gG][z]'
diff --git a/Completion/User/_gzip b/Completion/User/_gzip
new file mode 100644
index 000000000..3cda1e4ed
--- /dev/null
+++ b/Completion/User/_gzip
@@ -0,0 +1,3 @@
+#defcomp gzip
+
+_files -g '*~*.[gG][zZ]'
diff --git a/Completion/User/_hosts b/Completion/User/_hosts
new file mode 100644
index 000000000..3acc327ac
--- /dev/null
+++ b/Completion/User/_hosts
@@ -0,0 +1,3 @@
+#defcomp ftp ncftp ping rwho rup xping traceroute nslookup
+
+complist -k hosts
diff --git a/Completion/User/_make b/Completion/User/_make
new file mode 100644
index 000000000..d576b0308
--- /dev/null
+++ b/Completion/User/_make
@@ -0,0 +1,3 @@
+#defcomp make gmake pmake
+
+complist -s "\$(awk '/^[a-zA-Z0-9][^/ 	]+:/ {print \$1}' FS=: [mM]akefile)"
diff --git a/Completion/User/_man b/Completion/User/_man
new file mode 100644
index 000000000..8204fba0b
--- /dev/null
+++ b/Completion/User/_man
@@ -0,0 +1,11 @@
+#defcomp man
+setopt localoptions rcexpandparam
+
+local rep
+if [[ $2 = (<->*|ln) ]]; then
+  rep=( $manpath/(man|cat)$2/$PREFIX*$SUFFIX.<->*(N:t:r) )
+else
+  rep=( $manpath/(man|cat)*/$PREFIX*$SUFFIX.<->*(N:t:r) )
+fi
+
+(( $#rep )) && compadd -m $rep
diff --git a/Completion/User/_mh b/Completion/User/_mh
new file mode 100644
index 000000000..67ce49fd2
--- /dev/null
+++ b/Completion/User/_mh
@@ -0,0 +1,70 @@
+#defcomp folder comp inc mark refile repl scan show next prev rmm pick whom mhn mhpath mhpatch
+
+# Completion for all possible MH commands.
+# Alter the following two to your own mh directory and the directory
+# where standard mh library files live.  (It works anyway, but this
+# will save a little time.)
+local mymhdir=~/Mail
+local mhlib=/usr/lib/mh
+
+# To be on the safe side, check this exists and if not, get it anyway.
+[[ -d $mymhdir ]] || mymhdir=$(mhpath +)
+
+if [[ -iprefix - ]]; then
+  # get list of options, which MH commands can generate themselves
+  # awk is just too icky to use for this, sorry.  send me one if
+  # you come up with it.
+  compadd -m $($COMMAND -help | perl -ne 'if (/^\s*-\(?(\S+)/) {
+    $n = $1;
+    $n =~ s/\)//g;
+    print $n =~ s/^\[([a-z]+)\]// ? "$n\n$1$n\n" : "$n\n";
+  }')
+  return
+elif [[ -iprefix '+' || -iprefix '@' || -current -1 -draftfolder ]]; then
+  # Complete folder names.
+  local mhpath
+  if [[ $IPREFIX != '@' ]]; then
+    [[ $IPREFIX = '+' ]] || IPREFIX=+
+    mhpath=$mymhdir
+  else
+    mhpath=$(mhpath)
+  fi
+
+  # painless, or what?
+  complist -W mhpath -/
+elif [[ -mcurrent -1 -(editor|(whatnow|rmm|show|more)proc) ]]; then
+  complist -c
+elif [[ -current -1 -file ]]; then
+  complist -f
+elif [[ -mcurrent -1 -(form|audit|filter) ]]; then
+  # Need some MH template file, which may be in our own MH directory
+  # or with the standard library.
+  local mhfpath
+  # This is the only place we need mhlib, so leave the test till here.
+  [[ -d $mhlib ]] || { mhlib=$(mhparam mhlproc); mhlib=$mhlib:h; }
+  mhfpath=($mymhdir $mhlib)
+
+  complist -W mhfpath -g '*(.)'
+elif [[ -mcurrent -1 -(no|)cc ]]; then
+  compadd -m all to cc me
+elif [[ -mcurrent -1 -[rw]cache ]]; then
+  compadd -m public private never ask
+else
+  # Generate sequences.
+  local foldnam folddir f
+  for f in $argv; do
+    [[ $f = [@+]* ]] && foldnam=$f
+  done
+  if [[ $foldnam = '+'* ]]; then
+    folddir=$mymhdir/${foldnam#+}
+  elif [[ $foldnam = '@'* ]]; then
+    folddir=$(mhpath)/${foldnam#@}
+  else
+    folddir=$(mhpath)
+    # leaving foldnam empty works here
+  fi
+
+  complist -s '$(mark $foldnam | awk -F: '\''{ print $1 }'\'')'
+  compadd -m reply next cur prev first last all unseen
+  complist -W folddir -g '<->'
+fi
diff --git a/Completion/User/_pdf b/Completion/User/_pdf
new file mode 100644
index 000000000..7d7756c3e
--- /dev/null
+++ b/Completion/User/_pdf
@@ -0,0 +1,3 @@
+function acroread
+
+_files -g '*.(pdf|PDF)'
diff --git a/Completion/User/_ps b/Completion/User/_ps
new file mode 100644
index 000000000..6bc0643b2
--- /dev/null
+++ b/Completion/User/_ps
@@ -0,0 +1,3 @@
+#defcomp  gs ghostview gview psnup psselect pswrap pstops pstruct lpr
+
+_files -g '*([pP][sS]|eps)'
diff --git a/Completion/User/_rcs b/Completion/User/_rcs
new file mode 100644
index 000000000..537db6278
--- /dev/null
+++ b/Completion/User/_rcs
@@ -0,0 +1,9 @@
+#defcomp co ci rcs
+
+[[ $COMMAND = ci || $COMMAND = rcs ]] && _files
+
+if [[ $NMATCHES -eq 0 && -d RCS && $COMMAND != ci ]]; then
+  local rep
+  rep=(RCS/$PREFIX*$SUFFIX,v(:t:s/\,v//))
+  (( $#rep )) && compadd -m $rep
+fi
diff --git a/Completion/User/_rlogin b/Completion/User/_rlogin
new file mode 100644
index 000000000..e36554f23
--- /dev/null
+++ b/Completion/User/_rlogin
@@ -0,0 +1,9 @@
+#defcomp rlogin rsh ssh
+
+if [[ -position 1 ]]; then
+  complist -k hosts
+elif [[ -position 2 ]]; then
+  complist -k '(-l)'
+else
+  complist -u
+fi
diff --git a/Completion/User/_strip b/Completion/User/_strip
new file mode 100644
index 000000000..6962ac455
--- /dev/null
+++ b/Completion/User/_strip
@@ -0,0 +1,2 @@
+#defcomp strip
+_files -g '*(*)'
diff --git a/Completion/User/_stty b/Completion/User/_stty
new file mode 100644
index 000000000..6b54b5007
--- /dev/null
+++ b/Completion/User/_stty
@@ -0,0 +1,16 @@
+#defcomp stty
+
+if [[ -mcurrent -1 \
+  (*erase|discard|status|dsusp|intr|kill|lnext|quit|reprint|start|s*p) ]]
+then
+     compadd -m -Q '^-' '^h' '^?' '^c' '^u'
+else
+  [[ -string '-' || -string '+' ]]
+  compadd -m rows columns intr quit erase kill eof eol \
+    eol2 start stop susp dsusp reprint discard werase lnext \
+    parenb parodd cs8 cstopb hupcl cread clocal parext \
+    ignbrk brkint ignpar parmrk inpck istrip inlcr igncr icrnl iuclc \
+    ixon ixany ixoff imaxbel isig icanon xcase echo echoe echok \
+    echonl noflsh tostop echoctl echoprt echoke flusho pending iexten \
+    opost olcuc onlcr ocrnl onocr onlret ofill ofdel 
+fi
diff --git a/Completion/User/_tar b/Completion/User/_tar
new file mode 100644
index 000000000..91767e44d
--- /dev/null
+++ b/Completion/User/_tar
@@ -0,0 +1,11 @@
+#defcomp tar
+
+local nm=$NMATCHES tf="$2"
+
+if [[ ( -mword 1 *t*f* || -mword 1 *x*f* ) && -position 3 100000 ]]; then
+  complist -k "( $(tar tf $tf) )"
+elif [[ -mword 1 *c*f* && -position 3 100000 ]]; then
+  _files
+elif [[ -mcurrent -1 *f* && -position 2 ]]; then
+  _files -g '*.(tar|TAR)'
+fi
diff --git a/Completion/User/_tar_archive b/Completion/User/_tar_archive
new file mode 100644
index 000000000..58e436c4d
--- /dev/null
+++ b/Completion/User/_tar_archive
@@ -0,0 +1,20 @@
+#autoload
+
+# This is used to generate filenames usable as a tar archive. This may
+# get one argument, a collection of tar option characters that may be
+# used to find out what kind of filename is needed. If no argument is
+# given but the parameter `_tar_cmd' is set, that is used.
+# If your version of `tar' supports this you may want to complete
+# things like `host:file' or `user@host:file' here.
+
+[[ $# -eq 0 && $+_tar_cmd -ne 0 ]] && set "$_tar_cmd"
+
+if [[ "$1" = *[tx]* ]]; then
+  if [[ "$1" = *[zZ]* ]]; then
+    _files -g '*.((tar|TAR).(gz|GZ|Z)|.tgz)'
+  else
+    _files -g '*.(tar|TAR)'
+  fi
+else
+  _files
+fi
diff --git a/Completion/User/_tex b/Completion/User/_tex
new file mode 100644
index 000000000..1f645e2a2
--- /dev/null
+++ b/Completion/User/_tex
@@ -0,0 +1,3 @@
+#defcomp tex latex slitex
+
+_files -g '*.(tex|TEX|texinfo|texi)'
diff --git a/Completion/User/_uncompress b/Completion/User/_uncompress
new file mode 100644
index 000000000..e25805d50
--- /dev/null
+++ b/Completion/User/_uncompress
@@ -0,0 +1,3 @@
+#defcomp uncompress zmore
+
+_files -g '*.Z'
diff --git a/Completion/User/_x_options b/Completion/User/_x_options
new file mode 100644
index 000000000..cc469286d
--- /dev/null
+++ b/Completion/User/_x_options
@@ -0,0 +1,5 @@
+#defpatcomp */X11/*
+
+# A simple pattern completion, just as an example.
+
+complist -J options -k '(-display -name -xrm)'
diff --git a/Completion/User/_xfig b/Completion/User/_xfig
new file mode 100644
index 000000000..fcd2bba9f
--- /dev/null
+++ b/Completion/User/_xfig
@@ -0,0 +1,3 @@
+#defcomp xfig
+
+_files -g '*.fig'