Zsh 从手册页自动完成

Zsh 从手册页自动完成

我注意到具有以下特点:从手册页自动更新自动完成脚本。zsh 有类似的脚本可以做到这一点吗?

答案1

我无法引用官方文件给出权威答案,但我认为zsh 没有类似的脚本

让我做出这种假设的是例如最近的提交(缩短了!),其中的选项lsof是手动更新的(因此,如果存在一个可以解析手册页并更新完成的脚本,则这不是必需的):

Author:     Oliver Kiddle <[email protected]>                                                                                                               
CommitDate: Fri Dec 5 20:16:23 2014 +0100                                                                                                             

    33861: update lsof completion for new options                                                                                                     
---                                                                                                                                                   
 ChangeLog                     |  3 +++                                                                                                               
 Completion/Unix/Command/_lsof | 48 +++++++++++++++++++++++++++++++++++++++---------                                                                  
 2 files changed, 42 insertions(+), 9 deletions(-)                                                                                                    

diff --git a/ChangeLog b/ChangeLog                                                                                                                    
index ca2a602..f0b4754 100644                                                                                                                         
--- a/ChangeLog                                                                                                                                       
+++ b/ChangeLog                                                                                                                                       
@@ -1,5 +1,8 @@                                                                                                                                       
 2014-12-05  Oliver Kiddle  <[email protected]>                                                                                                             

+       * 33861: Completion/Unix/Command/_lsof:                                                                                                       
+       update lsof completion for new options                                                                                                        
+                                                                                                                                                     
        * 33860: Src/Zle/textobjects.c, Src/Zle/zle_misc.c,                                                                                           
        Src/Zle/zle_move.c, Src/Zle/zle_vi.c, Test/X02zlevi.ztst:                                                                                     
        minor fixes to vi mode changes                                                                                                                
diff --git a/Completion/Unix/Command/_lsof b/Completion/Unix/Command/_lsof                                                                            
index aca9963..c12b991 100644                                                                                                                         
--- a/Completion/Unix/Command/_lsof                                                                                                                   
+++ b/Completion/Unix/Command/_lsof                                                                                                                   
@@ -1,20 +1,35 @@                                                                                                                                     
 #compdef lsof                                                                                                                                        

   '-g[select by process group id]::process group id' \                                                                                               
   '*-i[select internet files]:address' \                                                                                                             
+  '-K[select listing of tasks of processes]' \                                                                                                       
   '-k[specify kernel name list file]:kernel file:_files' \                                                                                           
   '-l[inhibit conversion of UIDs to user names]' \

相关内容