about summary refs log tree commit diff
path: root/Completion/Builtins/_fc
diff options
context:
space:
mode:
authorOliver Kiddle <opk@users.sourceforge.net>2001-04-01 16:19:15 +0000
committerOliver Kiddle <opk@users.sourceforge.net>2001-04-01 16:19:15 +0000
commitb9c58a73ac2eace89340b268db852c8a158bd707 (patch)
treeca4e713df765174bc90fcc2e8c2a3be9288905de /Completion/Builtins/_fc
parente6be1f76cf77a63dd79dbe3d6eea62815caa87ab (diff)
downloadzsh-b9c58a73ac2eace89340b268db852c8a158bd707.tar.gz
zsh-b9c58a73ac2eace89340b268db852c8a158bd707.tar.xz
zsh-b9c58a73ac2eace89340b268db852c8a158bd707.zip
various doc fixes and minor completion function changes, most of which
are to use the -A "-*" and -S options to _arguments (13863)
Diffstat (limited to 'Completion/Builtins/_fc')
-rw-r--r--Completion/Builtins/_fc45
1 files changed, 27 insertions, 18 deletions
diff --git a/Completion/Builtins/_fc b/Completion/Builtins/_fc
index cb3efe48f..40d88db27 100644
--- a/Completion/Builtins/_fc
+++ b/Completion/Builtins/_fc
@@ -1,27 +1,36 @@
-#compdef fc history
+#compdef fc history r
 
-local fc_common
+local expl fc_common fc_hist fc_r
 
-fc_common=( \
-  '(-A -R -W -I)-m[treat first argument as a pattern]' \
-  '(-A -R -W -I)-r[reverse order of the commands]' \
-  '(-A -R -W -I -e)-n[suppress line numbers]' \
-  '(-A -R -W -I -e -f -E -i)-d[print time-stamps]' \
-  '(-A -R -W -I -e -d -E -i)-f[mm/dd/yyyy format time-stamps]' \
-  '(-A -R -W -I -e -d -f -i)-E[dd.mm.yyyy format time-stamps]' \
-  '(-A -R -W -I -e -d -f -E)-i[yyyy-mm-dd format time-stamps]' \
-  '(-A -R -W -I -e)-D[print elapsed times]' \
+fc_common=(
+  '(-A -R -W -I)-r[reverse order of the commands]'
+  '(-A -R -W -I -e)-n[suppress line numbers]'
   '(-A -R -W -I)*::commands:_command_names -e' )
 
-if [[ $service = *history ]]; then
-  _arguments -C -s "$fc_common[@]"
-else
-  _arguments -C -s \
-    '(-A -R -W -I -e)-l[list resulting commands on stdout]' \
+fc_hist=( \
+  '(-A -R -W -I)-m[treat first argument as a pattern]'
+  '(-A -R -W -I -e -f -E -i)-d[print time-stamps]'
+  '(-A -R -W -I -e -d -E -i)-f[mm/dd/yyyy format time-stamps]'
+  '(-A -R -W -I -e -d -f -i)-E[dd.mm.yyyy format time-stamps]'
+  '(-A -R -W -I -e -d -f -E)-i[yyyy-mm-dd format time-stamps]'
+  '(-A -R -W -I -e)-D[print elapsed times]' )
+
+fc_r='(-A -R -W -I -e)-l[list resulting commands on stdout]'
+
+case $service in
+  history)
+    _arguments -C -s -S "$fc_common[@]" "$fc_hist[@]" && return 0
+  ;;
+  r)
+    _arguments -C -s -S "$fc_common[@]" "$fc_r" && return 0
+  ;;
+  *)
+  _arguments -C -s -S \
     '(-A -R -W -I -l -n -d -f -E -i -D)-e[specify editor to invoke]:editor to invoke:_command_names -e' \
     '(-l -m -e -r -n -d -f -E -i -D -A -W *)-R[read history from file]:history file:_files' \
     '(-l -m -e -r -n -d -f -E -i -D -R -W *)-A[append history to file]:history file:_files' \
     '(-l -m -e -r -n -d -f -E -i -D -R -A *)-W[write history to file]:history file:_files' \
     '(-l -m -e -r -n -d -f -E -i -D -A -W *)-I[read/write new events only]:history file:_files' \
-    "$fc_common[@]"
-fi
+    "$fc_common[@]" "$fc_hist[@]" "$fc_r" && return 0
+  ;;
+esac