bin/vrowser in vrowser-0.1.2 vs bin/vrowser in vrowser-0.1.3
- old
+ new
@@ -57,16 +57,20 @@
:default => (Pathname.new(__FILE__).dirname.realpath + '../public_html').to_s
else
Trollop::die "unknown subcommand: #{cmd.inspect}"
end
end
+ return execute_sub_commands(cmd, cmd_opts)
+ end
- if sub_commands.include? cmd
+ def execute_sub_commands(cmd, cmd_opts)
+ if self.class.sub_commands.include? cmd
self.send("command_" + cmd, cmd_opts)
return 0
else
cmd_opts.help.display
+ return 1
end
end
### define sub commands
def command_list(options)
@@ -81,9 +85,16 @@
if File.exist? output_path
STDERR.puts "Already file exists!: #{output_path}"
else
FileUtils.cp(sample_config_path, options[:output_path])
STDOUT.puts "Generated sample config file: #{output_path}"
+ end
+ end
+
+ def command_fetch(options)
+ Vrowser.load_file(options[:config_file]) do |vrowser|
+ vrowser.fetch
+ vrowser.clear
end
end
def command_update(options)
Vrowser.load_file(options[:config_file]) do |vrowser|