From b9d7021c1ba9abdfceeffb36cb7c67885b1fb9fc Mon Sep 17 00:00:00 2001 From: Sascha Date: Thu, 25 Oct 2018 16:05:33 +0200 Subject: [PATCH] cli: set exit_on_failure for all CLI classes (#9094) --- lib/cli.rb | 4 ++++ lib/mastodon/accounts_cli.rb | 3 +++ lib/mastodon/emoji_cli.rb | 3 +++ lib/mastodon/feeds_cli.rb | 3 +++ lib/mastodon/media_cli.rb | 3 +++ lib/mastodon/settings_cli.rb | 3 +++ 6 files changed, 19 insertions(+) diff --git a/lib/cli.rb b/lib/cli.rb index 208df660f0..bff6d58097 100644 --- a/lib/cli.rb +++ b/lib/cli.rb @@ -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 diff --git a/lib/mastodon/accounts_cli.rb b/lib/mastodon/accounts_cli.rb index a32bc95332..0553330802 100644 --- a/lib/mastodon/accounts_cli.rb +++ b/lib/mastodon/accounts_cli.rb @@ -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 diff --git a/lib/mastodon/emoji_cli.rb b/lib/mastodon/emoji_cli.rb index 5bc51d034d..1987c63942 100644 --- a/lib/mastodon/emoji_cli.rb +++ b/lib/mastodon/emoji_cli.rb @@ -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 diff --git a/lib/mastodon/feeds_cli.rb b/lib/mastodon/feeds_cli.rb index cca65cf878..817ed4e799 100644 --- a/lib/mastodon/feeds_cli.rb +++ b/lib/mastodon/feeds_cli.rb @@ -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 diff --git a/lib/mastodon/media_cli.rb b/lib/mastodon/media_cli.rb index 8aa9f79039..95d2a8d64d 100644 --- a/lib/mastodon/media_cli.rb +++ b/lib/mastodon/media_cli.rb @@ -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 diff --git a/lib/mastodon/settings_cli.rb b/lib/mastodon/settings_cli.rb index 87c321013b..69485600a0 100644 --- a/lib/mastodon/settings_cli.rb +++ b/lib/mastodon/settings_cli.rb @@ -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