Class: RGitHook::CommandLine
Class Method Summary collapse
-
.execute(args) ⇒ Object
Parse command line options and execute.
Class Method Details
.execute(args) ⇒ Object
Parse command line options and execute
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/rgithook/command_line.rb', line 9 def self.execute(args) = (args) case .command when :install,:fetch,:edit ret_val = RGitHook.new(.path).send(.command) exit 0 when :version puts 'Version 3.0.0' exit 0 end rescue Grit::InvalidGitRepositoryError puts "Invalid Git repository:\n#{@options.path}" exit 1 end |