bin/earthquake in earthquake-0.7.1 vs bin/earthquake in earthquake-0.7.2
- old
+ new
@@ -3,28 +3,39 @@
argv = ARGV.dup
opts = Slop.parse! argv, :help => true do
banner "Usage: earthquake [options] [directory]"
on :d, :debug, 'Enable debug mode'
+ on :n, :'no-logo', 'No Logo'
+ on :c, :command, "Invoke an command and exit", true
end
options = opts.to_hash(true)
options.delete(:help)
options[:dir] = argv.shift unless argv.empty?
require 'pathname'
-eq_dir = Pathname.new(File.expand_path('../..', __FILE__)).realpath
+eq_dir = Pathname.new(__FILE__).realpath.parent.parent
$:.unshift eq_dir.join('lib') if $0 == __FILE__
-print "\e[31m"
-puts %q{
+command = options.delete(:command)
+no_logo = options.delete(:'no-logo')
+
+if !no_logo && !command
+ print "\e[31m"
+ puts %q{
_ _ _
___ __ _ _ __| |_| |__ __ _ _ _ __ _| | _____
/ _ \/ _` | '__| __| '_ \ / _` | | | |/ _` | |/ / _ \
| __/ (_| | | | |_| | | | (_| | |_| | (_| | < __/
\___|\__,_|_| \__|_| |_|\__, |\__,_|\__,_|_|\_\___|
|_| }.
-gsub(/^\n/, '') + "v#{eq_dir.join('VERSION').read}".rjust(10) + "\n\n"
-print "\e[0m"
+ gsub(/^\n/, '') + "v#{eq_dir.join('VERSION').read}".rjust(10) + "\n\n"
+ print "\e[0m"
+end
require 'earthquake'
-Earthquake.start(options)
\ No newline at end of file
+if command
+ Earthquake.invoke(command, options)
+else
+ Earthquake.start(options)
+end