adding-help: commit optimized tab completion and help

This commit is contained in:
rkiel
2015-06-07 21:38:20 -04:00
parent 8ce035330d
commit 218fa5a29c
4 changed files with 29 additions and 34 deletions

35
lib/feature/merge.rb Normal file
View File

@@ -0,0 +1,35 @@
require_relative './base'
module Feature
class Merge < Feature::Base
def valid?
[1,2].include? argv.size
end
def help
"feature merge [branch]"
end
def execute
parts = parse_branch(current_branch)
if argv.size == 2
merge_to_branch = argv[1]
elsif argv.size == 1
merge_to_branch = parts[:standard]
end
feature_branch = current_branch
error "invalid branch: #{merge_to_branch}" unless standard_branches.include? merge_to_branch
git_checkout merge_to_branch
git_pull merge_to_branch
git_merge feature_branch
git_push merge_to_branch
git_checkout feature_branch
end
end
end