class Gitomator::ScriptUtil::DefaultOptionParser
Public Class Methods
new(help_text)
click to toggle source
Calls superclass method
# File lib/gitomator/util/script_util.rb, line 18 def initialize(help_text) super() banner "#{help_text}\nOptions:" version "Gitomator #{Gitomator::VERSION} (c) 2016 Joey Freund" context_description = "YAML configuration for various service providers (e.g. GitHub hosting, or Travis CI)." unless ENV[DEFAULT_CONTEXT_ENV_VAR_NAME] context_description += "\nYou can override the default configuration file by setting the #{DEFAULT_CONTEXT_ENV_VAR_NAME} environment variable." end opt :context, context_description , :type => :string, :default => ScriptUtil::default_context_file end
Public Instance Methods
parse(args)
click to toggle source
Calls superclass method
# File lib/gitomator/util/script_util.rb, line 35 def parse(args) return { :context => ScriptUtil::default_context_file }.merge( Trollop::with_standard_exception_handling(self) { super(args) } ) end