about summary refs log tree commit diff
path: root/Completion/Builtins/_unsetopt
diff options
context:
space:
mode:
Diffstat (limited to 'Completion/Builtins/_unsetopt')
-rw-r--r--Completion/Builtins/_unsetopt7
1 files changed, 4 insertions, 3 deletions
diff --git a/Completion/Builtins/_unsetopt b/Completion/Builtins/_unsetopt
index 90d642b51..a5c85b1ef 100644
--- a/Completion/Builtins/_unsetopt
+++ b/Completion/Builtins/_unsetopt
@@ -1,7 +1,8 @@
 #defcomp unsetopt
 
-local nm=$NMATCHES
+local nm=$compstate[nmatches]
 
-complist -M 'L:|[nN][oO]= M:_= M:{A-Z}={a-z}' \
+compgen -M 'L:|[nN][oO]= M:_= M:{A-Z}={a-z}' \
          -s '$({ unsetopt kshoptionprint; setopt } 2>/dev/null)'
-[[ -nmatches nm ]] && complist -M 'L:|[nN][oO]= M:_= M:{A-Z}={a-z}' -o
+[[ compstate[nmatches] -eq nm ]] &&
+    compgen -M 'L:|[nN][oO]= M:_= M:{A-Z}={a-z}' -o