Class: RepoTender::CLI::Org::List

Inherits:
Dry::CLI::Command
  • Object
show all
Includes:
GlobalOptions
Defined in:
lib/repo_tender/cli/org.rb

Instance Method Summary collapse

Methods included from GlobalOptions

included

Instance Method Details

#call(plain: nil, json: nil, no_color: nil, quiet: nil) ⇒ Object



157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
# File 'lib/repo_tender/cli/org.rb', line 157

def call(plain: nil, json: nil, no_color: nil, quiet: nil, **)
  mode = UI::Mode.resolve(
    flags: {plain: plain, json: json, no_color: no_color, quiet: quiet},
    env: CLI.env,
    out: out
  )
  pastel = Pastel.new(enabled: mode.color)

  paths = CLI.make_paths
  config = Config::Store.load(paths.config_file).success
  if config.orgs.empty?
    out.puts pastel.dim("(no tracked orgs)")
  else
    config.orgs.each do |o|
      out.puts pastel.cyan("#{o.host}/#{o.name}" \
        " (include_archived=#{o.include_archived}, include_forks=#{o.include_forks})")
    end
  end
  CLI.record_outcome(Outcome.new(exit_code: 0))
end