class WTBuildHelpers::JIRA::Parser

Public Class Methods

parse(options) click to toggle source
# File lib/jira.rb, line 76
def self.parse(options)
    args = Options.new()
       
    opt_parser = OptionParser.new do |opts|
        opts.banner = "Usage: jira_update_from_build [options]"
    
        opts.on("-c", "--commits COMMIT_RANGE", "Specify a commit range") do |commit_range|
            args.commit_range = commit_range
        end
        
        opts.on("-u", "--username USERNAME", "Specify the user to connecto to JIRA") do |username|
            args.username = username
        end
        
        opts.on("-p", "--password PASSWORD", "Specify the password to connect to JIRA") do |password|
            args.password = password
        end
        
        opts.on("-s", "--site SITE", "Specify the base location of the JIRA instance") do |site|
            site.slice!("http://")
            site.insert(0, "https://") if not site.start_with?("https://")
            args.site = site
        end
        
        opts.on("-b", "--build BUILD", "The build number for which this script is executing") do |build|
            args.build = build
        end
        
        opts.on_tail("-h", "--help", "Show this message") do
            puts opts
            exit
        end
    end

    opt_parser.parse!(options)
    return args   
end