Stefano Zacchiroli escreveu isso aí:
> tags 438154 + confirmed
> thanks
> 
> On Wed, Aug 15, 2007 at 02:57:58PM -0300, Antonio Terceiro wrote:
> > Please find attached to this message a patch that adds a show command,
> > which displays information about the specified addons, like this:
> > 
> >  $ vim-addons show gnupg tetris matchit
> 
> I like the idea (actually, it was also on my todo list), and thanks for
> the patch! But I've a question about that, sorry if I'm being too lazy
> to check it by myself ATM, does the patch work properly even when
> system-wide mode of vim-addons is enabled?  I consider this a
> requirement and I expect that the user status of the addon is reported
> normally and that the *system* status is reported when system-wide mode
> is enabled. If (or when) this is supported properly I also suggest that
> the second line or your output does no longer read "User status", but
> simply "Status".

Yes, the patch works like this currently. The implementation uses
whatever is passed in as target_dir to Vim::AddonManager constructor.

$ ruby -I. vim-addons status xml
# Name                     User Status  System Status 
xml                         removed       removed       
$ sudo ruby -I. vim-addons install xml -w
Info: installing removed addon 'xml'
$ ruby -I. vim-addons status xml
# Name                     User Status  System Status 
xml                         removed       installed     
$ ruby -I. vim-addons show xml
Addon: xml
Status: removed
Description: editing helps for XML, HTML, and SGML documents

$ ruby -I. vim-addons show xml -w
Addon: xml
Status: installed
Description: editing helps for XML, HTML, and SGML documents

I adjusted the output to "Status:".

Follows attached an updated patch against the subversion repository.

-- 
Antonio Terceiro <[EMAIL PROTECTED]>
http://people.softwarelivre.org/~terceiro/
GnuPG ID: 0F9CB28F


Index: vim-addons
===================================================================
--- vim-addons	(revisão 1012)
+++ vim-addons	(cópia de trabalho)
@@ -21,7 +21,7 @@
 
 == SYNOPSIS
 
-vim-addons [OPTION ...] { list | status | install | remove | disable | amend | files } [ADDON ...]
+vim-addons [OPTION ...] { list | status | install | remove | disable | amend | files | show } [ADDON ...]
 
 == DESCRIPTION
 
@@ -86,6 +86,9 @@
   listed relative to components of the Vim runtimepath (see 'runtimepath' in
   the Vim help). Requires at least one addon argument
 
+:show
+  displays detailed information about the specified addons.
+
 == OPTIONS
 
 All commands accept the following options:
@@ -166,9 +169,9 @@
     :target_dir   => File.join(ENV['HOME'], '.vim'),
     :system_wide  => false
   }
-  cmds = %w{install remove disable amend list status files}
+  cmds = %w{install remove disable amend list status files show}
   req_arg_cmds = # commands requiring >= 1 arg
-    %w{install remove disable amend files}
+    %w{install remove disable amend files show}
   cmdline =
     GetoptLong.new(['--help', '-h', GetoptLong::NO_ARGUMENT],
                    ['--registry-dir', '-r', GetoptLong::REQUIRED_ARGUMENT],
Index: vim/addon-manager.rb
===================================================================
--- vim/addon-manager.rb	(revisão 1012)
+++ vim/addon-manager.rb	(cópia de trabalho)
@@ -113,6 +113,19 @@
       end
     end
 
+    def show(addons)
+      map_override_lines do |lines|
+        addons.each do |addon|
+          status = addon.status(@target_dir)
+
+          puts "Addon: #{addon}"
+          puts "Status: #{addon.status(@target_dir)}"
+          puts "Description: #{addon.description}"
+          puts ""
+        end
+      end
+    end
+
     private
     
     def map_override_lines

Reply via email to