diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2018-10-04 16:05:54 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-04 16:05:54 +0200 |
commit | 186024a058d4b8765a10d87ff3d7f3bdcd2fbb3c (patch) | |
tree | 94bfab12094d044547b088fdb54a1c9e2e876018 /lib/mastodon/settings_cli.rb | |
parent | e645ae95610fcb69d15366bc32ab60014d2ebdcf (diff) |
Add tootctl settings registrations open (#8829)
Diffstat (limited to 'lib/mastodon/settings_cli.rb')
-rw-r--r-- | lib/mastodon/settings_cli.rb | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/lib/mastodon/settings_cli.rb b/lib/mastodon/settings_cli.rb new file mode 100644 index 000000000..87c321013 --- /dev/null +++ b/lib/mastodon/settings_cli.rb @@ -0,0 +1,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 |