about summary refs log tree commit diff
path: root/lib/mastodon/settings_cli.rb
blob: 87c321013b9c554480ef4e1cccb13d1f4be4ed5d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# frozen_string_literal: true

require_relative '../../config/boot'
require_relative '../../config/environment'
require_relative 'cli_helper'

module Mastodon
  class RegistrationsCLI < Thor
    desc 'open', 'Open registrations'
    def open
      Setting.open_registrations = true
      say('OK', :green)
    end

    desc 'close', 'Close registrations'
    def close
      Setting.open_registrations = false
      say('OK', :green)
    end
  end

  class SettingsCLI < Thor
    desc 'registrations SUBCOMMAND ...ARGS', 'Manage state of registrations'
    subcommand 'registrations', RegistrationsCLI
  end
end