Class: VimGet::Commands::ListCommand
- Inherits:
-
BaseCommand
- Object
- BaseCommand
- VimGet::Commands::ListCommand
- Defined in:
- lib/vimget/commands/list_command.rb
Direct Known Subclasses
Constant Summary
Constants inherited from BaseCommand
Instance Attribute Summary
Attributes inherited from BaseCommand
#command, #defaults, #options, #options_group, #program_name, #summary
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(name = 'list', summary = 'Display all script in local') ⇒ ListCommand
constructor
A new instance of ListCommand.
Methods inherited from BaseCommand
#arguments, #invoke, #show_help, #usage
Constructor Details
#initialize(name = 'list', summary = 'Display all script in local') ⇒ ListCommand
Returns a new instance of ListCommand.
15 16 17 18 19 20 21 |
# File 'lib/vimget/commands/list_command.rb', line 15 def initialize(name = 'list', summary = 'Display all script in local') super(name, summary, :format => "plain") end |
Instance Method Details
#execute ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/vimget/commands/list_command.rb', line 23 def execute raise CommandLineError, "Ambiguous command!" if @options[:outdated] && @options[:installed] if @options[:outdated] scripts = VimGet.db.outdated_scripts elsif @options[:installed] scripts = VimGet.db.installed_scripts else scripts = VimGet.db.search end outputer = Output.new(@options[:format]) outputer.short(scripts) end |