# frozen_string_literal: true require_relative 'base' module Codeowners module Cli # Provide options for configuring the default owner used for filtering changes. class Config < Base default_task :list desc 'list', 'List the default values configured in the config file' def list puts(config.to_h.map { |name, value| "#{name}: #{value.inspect}" }) help_stderr if config.default_owner.empty? || config.default_organization.empty? end desc 'owner ', 'Configure a default owner name' def owner(name) config.default_owner = name puts "Default owner configured to #{name}" end desc 'organization ', 'Configure a default organization name' def organization(name) config.default_organization = name puts "Default organization configured to #{name}" end end end end