Class: Command::Remote

Inherits:
Base
  • Object
show all
Defined in:
lib/command/remote.rb

Instance Attribute Summary

Attributes inherited from Base

#status

Instance Method Summary collapse

Methods inherited from Base

#execute, #initialize

Constructor Details

This class inherits a constructor from Command::Base

Instance Method Details

#define_optionsObject



6
7
8
9
10
11
# File 'lib/command/remote.rb', line 6

def define_options
  @parser.on("-v", "--verbose") { @options[:verbose] = true }

  @options[:tracked] = []
  @parser.on("-t <branch>") { |branch| @options[:tracked].push(branch) }
end

#runObject



13
14
15
16
17
18
19
# File 'lib/command/remote.rb', line 13

def run
  case @args.shift
  when "add"    then add_remote
  when "remove" then remove_remote
  else               list_remotes
  end
end