bin/shaddox in shaddox-0.0.6 vs bin/shaddox in shaddox-0.0.7
- old
+ new
@@ -1,7 +1,46 @@
#!/usr/bin/env ruby
require 'shaddox'
+require 'optparse'
+
+@doxfile = './Doxfile'
+options = {
+ :verbose => true
+}
+
+OptionParser.new do |opts|
+
+ opts.banner = "Usage: shaddox [task] [target] [options]"
+
+ opts.on("-v", "--[no]-verbose", "Run verbosely") do |v|
+ options[:verbose] = v
+ end
+
+ opts.on("--force", "Override lock on target") do |force|
+ options[:force] = force
+ end
+
+ opts.on("--keep-tmp-dir", "Don't remove the tmpdir after deployment") do |force|
+ options[:force] = force
+ end
+
+ opts.on("--tmpdir PATH", "Specify the tmp directory to use (default '/tmp/shaddox')") do |dir|
+ options[:tmpdir] = dir
+ end
+
+ opts.on('-f PATH', '--doxfile', "Specify doxfile") do |f|
+ @doxfile = f
+ end
+
+ opts.on_tail("-h", "--help", "Show help text") do
+ puts opts
+ exit
+ end
+
+end.parse!
+
task = ARGV[0]
target = ARGV[1] || 'localhost'
-config = Shaddox::Config.new
-config.invoke(task.to_sym, target.to_sym)
+
+config = Shaddox::Config.new(@doxfile)
+config.invoke(task.to_sym, target.to_sym, options)