Class: Agent::Lock::CLI::Commands::List

Inherits:
Base
  • Object
show all
Defined in:
lib/agent/lock/cli/commands/list.rb

Overview

Everything in this tree's store, worktree siblings included, since they share one .git and therefore one set of locks.

Live claims and interrupted work are listed apart. An orphan blocks nobody, so counting it as held told a reader the tree was busier than it was, and gave them no way to see which locks were real.

Instance Attribute Summary

Attributes inherited from Base

#launcher

Instance Method Summary collapse

Methods inherited from Base

inherited, #initialize

Constructor Details

This class inherits a constructor from Agent::Lock::CLI::Commands::Base

Instance Method Details

#call(**options) ⇒ Manager::Result

Parameters:

  • options (Hash)

Returns:



24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/agent/lock/cli/commands/list.rb', line 24

def call(**options)
  manager = manager(options[:dir])
  result = manager.list

  if options[:json]
    report_records(result.records, json: true, stale_minutes: manager.stale_minutes)
  else
    report_listing(result.records, manager.stale_minutes)
  end

  finish(result)
end