40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
|
# File 'lib/rake_commit/commit.rb', line 40
def parse_options(args, options)
parser = OptionParser.new do |opts|
opts.banner = "Usage: rake_commit [OPTIONS]"
opts.on("-h", "--help", "Show this message") do
puts opts
exit
end
opts.on("-i", "--incremental", "Prompt for a local commit") do
options[:incremental] = true
end
opts.on("-n", "--no-collapse", "Run the build and push without pulling or collapsing commits") do
options[:collapse_commits] = false
end
opts.on("-r", "--rebase-only", "Pull and rebase (without collapsing existing commits), then build and push") do
options[:collapse_commits] = false
options[:rebase_only] = true
end
opts.on("-w", "--without-prompt PROMPT", "Skips the given prompt (author, feature, message)") do |prompt_exclusion|
options[:prompt_exclusions] << prompt_exclusion
end
opts.on("-p", "--precommit SCRIPT", "command to run before commiting changes") do |command|
options[:precommit] = command
end
opts.on("-b", "--build-command SCRIPT", "the command that verifies the commit, defaults to rake") do |command|
options[:build_command] = command
end
end
parser.parse(args)
options
end
|