Sha256: 3cfe114efe9c4fdc912f41e032ca5661e8d153ca05fa3d23c926aac1af753cbe
Contents?: true
Size: 952 Bytes
Versions: 53
Compression:
Stored size: 952 Bytes
Contents
require 'optparse' require 'logger' begin OptionParser.new do |opts| opts.banner = "Usage: zendesk c[onsole] [options]" opts.on("-v", "--[no-]verbose", "Run verbosely") do |v| config["logger.level"] = v ? Logger::INFO : Logger::WARN end opts.on("-c", "--config FILE", "Load a config file") do |c| config.replace(YAML.load_file(c)) end opts.on("-u", "--username USER", "Sets basic auth username") do |u| config["username"] = u end opts.on("-p", "--password PASS", "Sets basic auth password") do |p| config["password"] = p end opts.on("-a", "--api URL", "Sets api url") do |a| config["url"] = a end opts.on_tail("-h", "--help", "Show this message") do puts opts exit end opts.on_tail("--version", "Show version") do puts Zendesk::VERSION exit end end.parse! rescue OptionParser::MissingArgument => e puts e.message exit end
Version data entries
53 entries across 53 versions & 1 rubygems