bin/ratch in ratch-0.1 vs bin/ratch in ratch-0.2.1
- old
+ new
@@ -1,7 +1,53 @@
-#! /usr/bin/ruby
+#! /usr/bin/ruby1.8
-require 'ratch/cli/ratch'
+#require 'shellwords'
+require 'rbconfig' # replace with facets/rbsystem in future ?
+require 'ratch/batch'
+
+module Ratch
+
+ class RatchCommand
+
+ # Quick start.
+
+ def self.start(file)
+ new.run(file)
+ end
+
+ # Run task.
+
+ def run(file)
+ if file
+ BatchFile.new(file).call
+ else
+ help
+ end
+ end
+
+ # Dispaly help.
+
+ def help
+ help = <<-END
+ USAGE:
+
+ ratch [options] <taskfile>
+
+ OPTIONS:
+
+ --dryrun --nohram
+
+ --trace
+
+ --debug
+ END
+ puts help.gsub(/^\s+/, '')
+ end
+
+ end
+
+
+end
#load($0 = ARGV.shift)
Ratch::RatchCommand.start(ARGV.shift)