Package: vim-addon-manager
Version: 0.2
Severity: wishlist
Tags: patch

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
 Addon: tetris
 User status: removed
 Description: a Tetris game
 
 Addon: matchit
 User status: installed
 Description: extended matching with "%" (e.g. if ... then ... else)
 
 Addon: gnupg
 User status: removed
 Description: transparent editing of gpg encrypted files

Thanks,

-- System Information:
Debian Release: lenny/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: i386 (i686)

Kernel: Linux 2.6.22-1-686 (SMP w/1 CPU core)
Locale: LANG=pt_BR.utf8, LC_CTYPE=pt_BR.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages vim-addon-manager depends on:
ii  ruby                         1.8.2-1     An interpreter of object-oriented 
ii  vim-common                   1:7.1-056+2 Vi IMproved - Common files

Versions of packages vim-addon-manager recommends:
ii  vim-ruby [gvim]              1:7.1-056+2 Vi IMproved - enhanced vi editor -
ii  vim-tiny                     1:7.1-056+2 Vi IMproved - enhanced vi editor -

-- no debconf information

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


Index: vim-addon-manager-0.2/src/vim-addons
===================================================================
--- vim-addon-manager-0.2.orig/src/vim-addons   2007-08-15 14:35:58.487269693 
-0300
+++ vim-addon-manager-0.2/src/vim-addons        2007-08-15 14:51:11.539301563 
-0300
@@ -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
+  display more 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-0.2/src/vim/addon-manager.rb
===================================================================
--- vim-addon-manager-0.2.orig/src/vim/addon-manager.rb 2007-08-15 
14:32:31.475472763 -0300
+++ vim-addon-manager-0.2/src/vim/addon-manager.rb      2007-08-15 
14:51:23.539985443 -0300
@@ -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 "User status: #{addon.status(@target_dir)}"
+         puts "Description: #{addon.description}"
+         puts ""
+       end
+      end
+    end
+
     private
     
     def map_override_lines

Reply via email to