]> cat aescling's git repositories - mastodon.git/blob - lib/mastodon/settings_cli.rb
cli: set exit_on_failure for all CLI classes (#9094)
[mastodon.git] / lib / mastodon / settings_cli.rb
1 # frozen_string_literal: true
2
3 require_relative '../../config/boot'
4 require_relative '../../config/environment'
5 require_relative 'cli_helper'
6
7 module Mastodon
8 class RegistrationsCLI < Thor
9 def self.exit_on_failure?
10 true
11 end
12 desc 'open', 'Open registrations'
13 def open
14 Setting.open_registrations = true
15 say('OK', :green)
16 end
17
18 desc 'close', 'Close registrations'
19 def close
20 Setting.open_registrations = false
21 say('OK', :green)
22 end
23 end
24
25 class SettingsCLI < Thor
26 desc 'registrations SUBCOMMAND ...ARGS', 'Manage state of registrations'
27 subcommand 'registrations', RegistrationsCLI
28 end
29 end
This page took 0.09589 seconds and 4 git commands to generate.