Class: Avm::Tools::Runner::Git::DirtyFiles

Inherits:
EacRubyUtils::Console::DocoptRunner
  • Object
show all
Defined in:
lib/avm/tools/runner/git/dirty_files.rb

Constant Summary collapse

FIELDS =
{
  i: :index, w: :worktree, p: :path, a: :absolute_path
}.map { |k, v| ["%#{k}", v] }.to_h
FIELDS_DOC =
FIELDS.map { |k, v| "  #{k} => #{v}" }.join("\n")
DOC =
"Lists dirty files in Git repository.\n\nUsage:\n  __PROGRAM__ [options]\n  __PROGRAM__ -h | --help\n\nOptions:\n  -h --help                     Mostra esta ajuda.\n  -f --format=<format>          Format of each line (See \"Format fields\") [default: %p].\n\nFormat fields:\n\#{FIELDS_DOC}\n"

Instance Method Summary collapse

Instance Method Details

#runObject



34
35
36
37
38
# File 'lib/avm/tools/runner/git/dirty_files.rb', line 34

def run
  context(:git).dirty_files.each do |file|
    out("#{format_file(file)}\n")
  end
end