about summary refs log tree commit diff
path: root/lib/cli.rb
diff options
context:
space:
mode:
authortateisu <tateisu@gmail.com>2020-06-25 19:17:10 +0900
committerGitHub <noreply@github.com>2020-06-25 12:17:10 +0200
commit370e38ee15da6ff0b85c048486b56b173c1d4b02 (patch)
tree5835f4fe2affde2e9f6b3f41aee0e32ddaf8cf94 /lib/cli.rb
parent62ef6406cd67170d3eb57d2a1d55fb074a9d603c (diff)
Add tootctl email-domain-blocks (#13589)
* Add tootctl email_domains (block|unblock)

* fix codeclimate issues.

* fix codeclimate issues.

* fix codeclimate issues.

* add list subcommand, remove log_action.

* fix codeclimate issues.

* filter duplicate hostnames,ips before block

* rebase from currnet master branch.
rename email_domains_cli.rb to email_domain_blocks_cli.rb .
rename Mastodon::EmailDomainsCLI to Mastodon::EmailDomainBlocksCLI .
rename command email_domains to email-domain-blocks . (Thor recognizes both of - and _ )
rename subcommand block to add .
rename subcommand unblock to remove .
change the color in list subcommand to while for domain or cyan for childlen.
don't use include() in list subcommand.
suppress console output about succeeded entry.
add console output about count of processed/skipped.
remove capitalization in subcommand description.
remove long_desc in subcommand 'remove'.
remove duplicate where in subcommand 'remove'.

* fix codeclimate issue.
Diffstat (limited to 'lib/cli.rb')
-rw-r--r--lib/cli.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/cli.rb b/lib/cli.rb
index 313a36a3d..7cab0d5a1 100644
--- a/lib/cli.rb
+++ b/lib/cli.rb
@@ -12,6 +12,7 @@ require_relative 'mastodon/domains_cli'
 require_relative 'mastodon/preview_cards_cli'
 require_relative 'mastodon/cache_cli'
 require_relative 'mastodon/upgrade_cli'
+require_relative 'mastodon/email_domain_blocks_cli'
 require_relative 'mastodon/version'
 
 module Mastodon
@@ -53,6 +54,9 @@ module Mastodon
     desc 'upgrade SUBCOMMAND ...ARGS', 'Various version upgrade utilities'
     subcommand 'upgrade', Mastodon::UpgradeCLI
 
+    desc 'email-domain-blocks SUBCOMMAND ...ARGS', 'Manage E-mail domain blocks'
+    subcommand 'email_domain_blocks', Mastodon::EmailDomainBlocksCLI
+
     option :dry_run, type: :boolean
     desc 'self-destruct', 'Erase the server from the federation'
     long_desc <<~LONG_DESC