breakout commit

This commit is contained in:
rkiel
2015-06-06 07:16:32 -04:00
parent a68a450006
commit db0a6f5501
3 changed files with 38 additions and 7 deletions

30
lib/commit/commander.rb Normal file
View File

@@ -0,0 +1,30 @@
module Commit
class Commander
attr_reader :argv
def initialize (argv)
@argv = argv
end
def valid?
argv.size > 0
end
def help
puts
puts "USAGE: commit [word....]"
puts
exit
end
def execute
comment = argv.reject { |x| x == '-m' }.join(' ')
command = "git commit -m \"#{comment}\""
exec command
end
end
end

View File

@@ -4,7 +4,7 @@ module Feature
class End < Feature::Base
def execute
error "USAGE: feature end" unless ARGV.size == 1
error "USAGE: feature end" unless argv.size == 1
parts = parse_branch(current_branch)