Handle CLI failure exit status at the top-level script (#28322)

This commit is contained in:
Matt Jankowski 2024-01-26 03:53:44 -05:00 committed by GitHub
commit 0e0a94f483
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
27 changed files with 150 additions and 320 deletions

View file

@ -20,10 +20,7 @@ module Mastodon::CLI
option to overwrite it.
LONG_DESC
def add(*addresses)
if addresses.empty?
say('No IP(s) given', :red)
exit(1)
end
fail_with_message 'No IP(s) given' if addresses.empty?
skipped = 0
processed = 0
@ -70,10 +67,7 @@ module Mastodon::CLI
cover the given IP(s).
LONG_DESC
def remove(*addresses)
if addresses.empty?
say('No IP(s) given', :red)
exit(1)
end
fail_with_message 'No IP(s) given' if addresses.empty?
processed = 0
skipped = 0