1
0
Fork 0
forked from gitea/nas

Add CLI Base class for command line code (#25106)

This commit is contained in:
Matt Jankowski 2023-05-24 05:55:40 -04:00 committed by GitHub
parent d2e5430d4a
commit 384345b0de
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
33 changed files with 238 additions and 155 deletions

View file

@ -1,15 +1,9 @@
# frozen_string_literal: true
require_relative '../../../config/boot'
require_relative '../../../config/environment'
require_relative 'helper'
require_relative 'base'
module Mastodon::CLI
class Registrations < Thor
def self.exit_on_failure?
true
end
class Registrations < Base
desc 'open', 'Open registrations'
def open
Setting.registrations_mode = 'open'
@ -37,7 +31,7 @@ module Mastodon::CLI
end
end
class Settings < Thor
class Settings < Base
desc 'registrations SUBCOMMAND ...ARGS', 'Manage state of registrations'
subcommand 'registrations', Registrations
end