diff --git a/developer/bin/list_login_items_for_app b/developer/bin/list_login_items_for_app index f775347efc..d3143766b5 100755 --- a/developer/bin/list_login_items_for_app +++ b/developer/bin/list_login_items_for_app @@ -14,25 +14,25 @@ require "open3" ### def usage - <<-EOS -Usage: list_login_items_for_app + <<~EOS + Usage: list_login_items_for_app -Given an Application (app) bundle directory on disk, find all -login items associated with that app, which you can use in a -Cask uninstall stanza, eg + Given an Application (app) bundle directory on disk, find all + login items associated with that app, which you can use in a + Cask uninstall stanza, eg - uninstall login_item: 'login item name' + uninstall login_item: 'login item name' -Note that you will likely need to have opened the app at least -once for any login items to be present. + Note that you will likely need to have opened the app at least + once for any login items to be present. -See CONTRIBUTING.md for more information. + See CONTRIBUTING.md for more information. -EOS + EOS end def process_args - if ARGV.first =~ %r{^-+h(?:elp)?$} + if /^-+h(?:elp)?$/.match?(ARGV.first) puts usage exit 0 elsif ARGV.length == 1 @@ -49,7 +49,7 @@ def list_login_items_for_app(app_path) "tell application \"System Events\" to get the name of every login item " \ "whose path contains \"#{File.basename(app_path)}\"" ) - if status.exitstatus > 0 + if status.exitstatus.positive? $stderr.puts err exit status.exitstatus end