Browse Source

cli: set exit_on_failure for all CLI classes (#9094)

pull/4/head
Sascha 5 years ago
committed by Eugen Rochko
parent
commit
b9d7021c1b
6 changed files with 19 additions and 0 deletions
  1. +4
    -0
      lib/cli.rb
  2. +3
    -0
      lib/mastodon/accounts_cli.rb
  3. +3
    -0
      lib/mastodon/emoji_cli.rb
  4. +3
    -0
      lib/mastodon/feeds_cli.rb
  5. +3
    -0
      lib/mastodon/media_cli.rb
  6. +3
    -0
      lib/mastodon/settings_cli.rb

+ 4
- 0
lib/cli.rb View File

@ -9,6 +9,10 @@ require_relative 'mastodon/settings_cli'
module Mastodon
class CLI < Thor
def self.exit_on_failure?
true
end
desc 'media SUBCOMMAND ...ARGS', 'Manage media files'
subcommand 'media', Mastodon::MediaCLI

+ 3
- 0
lib/mastodon/accounts_cli.rb View File

@ -7,6 +7,9 @@ require_relative 'cli_helper'
module Mastodon
class AccountsCLI < Thor
def self.exit_on_failure?
true
end
option :all, type: :boolean
desc 'rotate [USERNAME]', 'Generate and broadcast new keys'
long_desc <<-LONG_DESC

+ 3
- 0
lib/mastodon/emoji_cli.rb View File

@ -7,6 +7,9 @@ require_relative 'cli_helper'
module Mastodon
class EmojiCLI < Thor
def self.exit_on_failure?
true
end
option :prefix
option :suffix
option :overwrite, type: :boolean

+ 3
- 0
lib/mastodon/feeds_cli.rb View File

@ -6,6 +6,9 @@ require_relative 'cli_helper'
module Mastodon
class FeedsCLI < Thor
def self.exit_on_failure?
true
end
option :all, type: :boolean, default: false
option :background, type: :boolean, default: false
option :dry_run, type: :boolean, default: false

+ 3
- 0
lib/mastodon/media_cli.rb View File

@ -6,6 +6,9 @@ require_relative 'cli_helper'
module Mastodon
class MediaCLI < Thor
def self.exit_on_failure?
true
end
option :days, type: :numeric, default: 7
option :background, type: :boolean, default: false
option :verbose, type: :boolean, default: false

+ 3
- 0
lib/mastodon/settings_cli.rb View File

@ -6,6 +6,9 @@ require_relative 'cli_helper'
module Mastodon
class RegistrationsCLI < Thor
def self.exit_on_failure?
true
end
desc 'open', 'Open registrations'
def open
Setting.open_registrations = true

Loading…
Cancel
Save