1
0

cli.rb 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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/domains_cli'
  9. require_relative 'mastodon/version'
  10. module Mastodon
  11. class CLI < Thor
  12. def self.exit_on_failure?
  13. true
  14. end
  15. desc 'media SUBCOMMAND ...ARGS', 'Manage media files'
  16. subcommand 'media', Mastodon::MediaCLI
  17. desc 'emoji SUBCOMMAND ...ARGS', 'Manage custom emoji'
  18. subcommand 'emoji', Mastodon::EmojiCLI
  19. desc 'accounts SUBCOMMAND ...ARGS', 'Manage accounts'
  20. subcommand 'accounts', Mastodon::AccountsCLI
  21. desc 'feeds SUBCOMMAND ...ARGS', 'Manage feeds'
  22. subcommand 'feeds', Mastodon::FeedsCLI
  23. desc 'settings SUBCOMMAND ...ARGS', 'Manage dynamic settings'
  24. subcommand 'settings', Mastodon::SettingsCLI
  25. desc 'domains SUBCOMMAND ...ARGS', 'Manage account domains'
  26. subcommand 'domains', Mastodon::DomainsCLI
  27. map %w(--version -v) => :version
  28. desc 'version', 'Show version'
  29. def version
  30. say(Mastodon::Version.to_s)
  31. end
  32. end
  33. end