summary refs log tree commit diff
path: root/Completion/Unix/Command/_killall
diff options
context:
space:
mode:
authorOliver Kiddle <opk@zsh.org>2021-11-24 23:07:18 +0100
committerOliver Kiddle <opk@zsh.org>2021-11-24 23:09:38 +0100
commit16d5d6a9dae526355caf16f2de9d57d84b5d9993 (patch)
tree6ab30a2ad2596523b85aa553ffa8a4544632fd7a /Completion/Unix/Command/_killall
parent138f5bf144589a59ef009f26332652291cd0a944 (diff)
downloadzsh-16d5d6a9dae526355caf16f2de9d57d84b5d9993.tar.gz
zsh-16d5d6a9dae526355caf16f2de9d57d84b5d9993.tar.xz
zsh-16d5d6a9dae526355caf16f2de9d57d84b5d9993.zip
49597: add a helper for completing numbers with unit suffixes and separate out defaults, ranges and units in completion descriptions
Diffstat (limited to 'Completion/Unix/Command/_killall')
-rw-r--r--Completion/Unix/Command/_killall12
1 files changed, 3 insertions, 9 deletions
diff --git a/Completion/Unix/Command/_killall b/Completion/Unix/Command/_killall
index 36accb2e0..3ddd36341 100644
--- a/Completion/Unix/Command/_killall
+++ b/Completion/Unix/Command/_killall
@@ -38,15 +38,9 @@ if _pick_variant psmisc=PSmisc unix --version; then
 
   case $state in
     (time)
-      local -a units=( 's:seconds' 'm:minutes' 'h:hours' 'd:days'
-			'w:weeks' 'M:months' 'y:years' )
-      if compset -P '[0-9]##(|.[0-9]#)'; then
-	_alternative 'float-numbers:: _message "float number"' \
-		    'units:: _describe unit units' && ret=0
-      else
-	_message 'float number and unit' && ret=0
-      fi
-      ;;
+      _numbers -fN age 's:seconds' 'm:minutes' 'h:hours' 'd:days' \
+          'w:weeks' 'M:months' 'y:years'
+    ;;
   esac
 
   return ret