Class: Homebrew::Cmd::TapInfo

Inherits:
AbstractCommand show all
Defined in:
cmd/tap-info.rb

Instance Attribute Summary

Attributes inherited from AbstractCommand

#args

Instance Method Summary collapse

Methods inherited from AbstractCommand

command, command_name, #initialize, parser

Constructor Details

This class inherits a constructor from Homebrew::AbstractCommand

Instance Method Details

#runvoid

This method returns an undefined value.



25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'cmd/tap-info.rb', line 25

def run
  taps = if args.installed?
    Tap
  else
    args.named.to_taps
  end

  if args.json
    raise UsageError, "invalid JSON version: #{args.json}" unless ["v1", true].include? args.json

    print_tap_json(taps.sort_by(&:to_s))
  else
    print_tap_info(taps.sort_by(&:to_s))
  end
end