Class: Rebaser::Parser
- Inherits:
-
Object
- Object
- Rebaser::Parser
- Defined in:
- lib/rebaser/parser.rb
Instance Method Summary collapse
-
#initialize(args) ⇒ Parser
constructor
A new instance of Parser.
- #parse ⇒ Object
Constructor Details
#initialize(args) ⇒ Parser
Returns a new instance of Parser.
5 6 7 |
# File 'lib/rebaser/parser.rb', line 5 def initialize(args) @args = args end |
Instance Method Details
#parse ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/rebaser/parser.rb', line 9 def parse = {} OptionParser.new do |opts| opts.on("--username USERNAME", String, "Your github username") do |v| [:username] = v end opts.on("--password PASSWORD", String, "Your github password") do |v| [:password] = v end opts.on("--token TOKEN", String, "Your github two factor authentication code") do |v| [:token] = v end opts.on("--remote REMOTE", String, "The git remote in the form of `timminkov/rebaser`") do |v| [:remote] = v end opts.on("--branch BRANCH", String, "Branch name to rebase onto") do |v| [:rebase_branch] = v end end.parse(args) end |