Class: MGit::StatusCommand

Inherits:
Command
  • Object
show all
Defined in:
lib/mgit/commands/status.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



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

def arity
  [nil, 0]
end

#descriptionObject



19
20
21
# File 'lib/mgit/commands/status.rb', line 19

def description
  'display status for each repository'
end

#execute(_) ⇒ Object



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

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

#usageObject



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

def usage
  'status'
end