闭社主体 forked from https://github.com/tootsuite/mastodon
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

47 lines
1.3 KiB

  1. # frozen_string_literal: true
  2. require 'thor'
  3. require_relative 'mastodon/media_cli'
  4. require_relative 'mastodon/emoji_cli'
  5. require_relative 'mastodon/accounts_cli'
  6. require_relative 'mastodon/feeds_cli'
  7. require_relative 'mastodon/settings_cli'
  8. require_relative 'mastodon/statuses_cli'
  9. require_relative 'mastodon/domains_cli'
  10. require_relative 'mastodon/version'
  11. module Mastodon
  12. class CLI < Thor
  13. def self.exit_on_failure?
  14. true
  15. end
  16. desc 'media SUBCOMMAND ...ARGS', 'Manage media files'
  17. subcommand 'media', Mastodon::MediaCLI
  18. desc 'emoji SUBCOMMAND ...ARGS', 'Manage custom emoji'
  19. subcommand 'emoji', Mastodon::EmojiCLI
  20. desc 'accounts SUBCOMMAND ...ARGS', 'Manage accounts'
  21. subcommand 'accounts', Mastodon::AccountsCLI
  22. desc 'feeds SUBCOMMAND ...ARGS', 'Manage feeds'
  23. subcommand 'feeds', Mastodon::FeedsCLI
  24. desc 'settings SUBCOMMAND ...ARGS', 'Manage dynamic settings'
  25. subcommand 'settings', Mastodon::SettingsCLI
  26. desc 'statuses SUBCOMMAND ...ARGS', 'Manage statuses'
  27. subcommand 'statuses', Mastodon::StatusesCLI
  28. desc 'domains SUBCOMMAND ...ARGS', 'Manage account domains'
  29. subcommand 'domains', Mastodon::DomainsCLI
  30. map %w(--version -v) => :version
  31. desc 'version', 'Show version'
  32. def version
  33. say(Mastodon::Version.to_s)
  34. end
  35. end
  36. end