5

I noticed that fish has a feature to auto update auto completion scripts from man page. Does zsh have a similar script to do this?

1

I cannot give an authoritative answer quoting from official documents, but I suppose that zsh does not have a similar script.

What leads me to that assumption is e.g. this recent commit (shortened!), where the options for lsof are updated manually (so if a script exists which parses the man pages and updates the completion, this would not be necessary):

Author:     Oliver Kiddle <opk@zsh.org>                                                                                                               
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  <opk@zsh.org>                                                                                                             

+       * 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]' \
| improve this answer | |
  • I don't understand how this answers with my question.. – xuhdev Jan 13 '15 at 19:30
  • @xuhdev: Your question: Does zsh have a similar script to do this? My answer: I suppose not. But I try to formulate it a bit better... – mpy Jan 13 '15 at 19:34
  • Thanks for your explanation! But I don't think your proof is really convincing, as fish also manually maintains a large set of auto completion scripts. Auto completion generated from man page is not as good as these manually maintained scripts, they are just complementary to make those missing scripts available. – xuhdev Jan 13 '15 at 19:43
  • @xuhdev: Ok, I don't know much about fish... but you're absolutely right, that is no proper proof. I just wanted to show what leads me to my assumption. Let's look what other answers will pop up... – mpy Jan 13 '15 at 19:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.