about summary refs log tree commit diff
path: root/lib
diff options
context:
space:
mode:
authorSascha <sascha@serenitylabs.cloud>2018-10-25 16:05:33 +0200
committerEugen Rochko <eugen@zeonfederated.com>2018-10-25 16:05:33 +0200
commitb9d7021c1ba9abdfceeffb36cb7c67885b1fb9fc (patch)
treeb7d5a5461ce614fbf44d102d663953d6857be9e4 /lib
parent8445f77a5b9b7c1c16216422f04c44783ffbd2db (diff)
cli: set exit_on_failure for all CLI classes (#9094)
Diffstat (limited to 'lib')
-rw-r--r--lib/cli.rb4
-rw-r--r--lib/mastodon/accounts_cli.rb3
-rw-r--r--lib/mastodon/emoji_cli.rb3
-rw-r--r--lib/mastodon/feeds_cli.rb3
-rw-r--r--lib/mastodon/media_cli.rb3
-rw-r--r--lib/mastodon/settings_cli.rb3
6 files changed, 19 insertions, 0 deletions
diff --git a/lib/cli.rb b/lib/cli.rb
index 208df660f..bff6d5809 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 a32bc9533..055333080 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 5bc51d034..1987c6394 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 cca65cf87..817ed4e79 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 8aa9f7903..95d2a8d64 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 87c321013..69485600a 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