Class: MGit::ListCommand

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

Instance Method Summary collapse

Methods inherited from Command

#check_arity, create, execute, instance_each, list, load_commands, register_alias, register_command, require_commands_from_directory

Methods included from Output

#perror, #pinfo, #psystem, #ptable, #pwarn

Instance Method Details

#arityObject



9
10
11
# File 'lib/mgit/commands/list.rb', line 9

def arity
  [nil, 0]
end

#descriptionObject



17
18
19
# File 'lib/mgit/commands/list.rb', line 17

def description
  'list all repositories'
end

#execute(_) ⇒ Object



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

def execute(_)
  t = []
  Registry.each { |repo| t << [repo.name, repo.path] }
  ptable t, columns: [24, nil]
end

#usageObject



13
14
15
# File 'lib/mgit/commands/list.rb', line 13

def usage
  'list'
end