16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
|
# File 'lib/vim_pathogen_plugin_manager.rb', line 16
def parse_options
@options = {}
@opts = OptionParser.new
@opts.banner = "Usage: plugin_manager.rb [options]"
@opts.on("-u", "--update", "Update all Vim plugins") do |u|
@options[:action] = "u"
end
@opts.on("-i", "--install", "Install Vim plugins from list [bundle.list]") do |i|
@options[:action] = "i"
end
@opts.on("-r", "--remove", "Remove Vim plugins not on the list [bundle.list]") do |r|
@options[:action] = "r"
end
@opts.on("-p", "--path [path_to_file]", "Path to [bundle.list]") do |p|
@options[:path] = p
end
@opts.on_tail("-h", "--help", "Show this message") do
puts @opts
exit
end
@opts.on_tail("--version", "Show version") do
puts VimPathogenPluginManager::VERSION
exit
end
@opts.on_tail("--usage", "Show usage example") do
puts "Example usage (install plugins)".colorize(:yellow) + " vim_pathogen_plugin_manager -i -p /home/user/custom_bundle.list".colorize(:light_blue)
exit
end
begin
@opts.parse!(ARGV)
rescue OptionParser::InvalidOption => e
puts e
puts @opts
end
end
|