about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog3
-rw-r--r--Completion/Unix/Command/_man6
2 files changed, 8 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 5a60c113b..e55719369 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2017-01-05  Daniel Shahaf  <d.s@daniel.shahaf.name>
 
+	* 40264: Completion/Unix/Command/_man: Complete all sections
+	after '-a'.
+
 	* users/22320: Etc/BUGS: Add 40240, label 40106.
 
 2017-01-05  Oliver Kiddle  <opk@zsh.org>
diff --git a/Completion/Unix/Command/_man b/Completion/Unix/Command/_man
index b2aaeaf7e..67810e1dc 100644
--- a/Completion/Unix/Command/_man
+++ b/Completion/Unix/Command/_man
@@ -51,7 +51,11 @@ _man() {
     sect="${sect//:/|}"
     sect="${sect//,/|}"
   elif (( CURRENT > 2 )); then
-    sect=$words[2]
+    case $words[2] in
+      (-a) sect='*';;
+      (-*) ;;
+      (*)  sect=$words[2];;
+    esac
   fi
 
   if [[ $sect = (<->*|1M|l|n) || $sect = *\|* ]]; then