Class: MGit::ListCommand

Inherits:
Command show all
Defined in:
lib/mgit/commands/list.rb

Instance Method Summary collapse

Methods inherited from Command

create, #help, instance_each, list, register_alias, register_command

Instance Method Details

#descriptionObject



15
16
17
# File 'lib/mgit/commands/list.rb', line 15

def description
  'list all repositories'
end

#execute(args) ⇒ Object



3
4
5
6
7
8
9
# File 'lib/mgit/commands/list.rb', line 3

def execute(args)
  raise TooManyArgumentsError.new(self) if args.size != 0

  Repository.each do |name, path|
    puts "#{name} => #{path}"
  end
end

#usageObject



11
12
13
# File 'lib/mgit/commands/list.rb', line 11

def usage
  'list'
end