lib/cli.rb in inqlude-0.0.4 vs lib/cli.rb in inqlude-0.0.5
- old
+ new
@@ -17,10 +17,11 @@
class Cli < Thor
default_task :global
class_option :version, :type => :boolean, :desc => "Show version"
+ class_option :offline, :type => :boolean, :desc => "Work offline"
def self.settings= s
@@settings = s
end
@@ -70,10 +71,12 @@
method_option :output_dir, :type => :string, :aliases => "-o",
:desc => "Output directory", :required => true
method_option :enable_disqus, :type => :boolean,
:desc => "Enable Disqus based comments on generate web pages. Works only on actual domain."
def view
+ process_global_options options
+
view = View.new ManifestHandler.new @@settings
view.enable_disqus = options[:enable_disqus]
view.create options[:output_dir]
end
@@ -132,8 +135,14 @@
if !manifest
STDERR.puts "Manifest for '#{name}' not found"
else
@@distro.install manifest
end
+ end
+
+ private
+
+ def process_global_options options
+ @@settings.offline = options[:offline]
end
end