lib/gurney/cli/option_parser.rb in gurney_client-0.1.5 vs lib/gurney/cli/option_parser.rb in gurney_client-0.1.6
- old
+ new
@@ -6,10 +6,11 @@
class OptionParser
def self.parse(args)
options = OpenStruct.new
options.hook = false
+ options.client_hook = false
options.config_file = 'gurney.yml'
option_parser = ::OptionParser.new do |opts|
opts.banner = "Usage: gurney [options]"
@@ -18,19 +19,23 @@
"Url for web api call, can have parameters for <project_id> and <branch>" ,
"example: --api-url \"http://example.com/project/<project_id>/branch/<branch>\"") do |api_url|
options.api_url = api_url
end
- opts.on('', '--api-token [API TOKEN]', 'Token to be send to api in the X-AuthToken header') do |api_token|
+ opts.on('', '--api-token [API TOKEN]', 'Token to be send to the api in the X-AuthToken header') do |api_token|
options.api_token = api_token
end
opts.on('-c', '--config [CONFIG FILE]', 'Config file to use') do |config_file|
options.config_file = config_file
end
opts.on('-h', '--hook', 'Run as a git post-receive hook') do |hook|
options.hook = hook
+ end
+
+ opts.on('', '--client-hook', 'Run as a git pre-push hook') do |client_hook|
+ options.client_hook = client_hook
end
opts.on('-p', '--project-id [PROJECT ID]', 'Specify project id for api') do |project_id|
options.project_id = project_id
end