Merge pull request #5482 from sjackman/info-json

info: Fix style: Use a guard clause
This commit is contained in:
Mike McQuaid 2019-01-04 20:28:22 +00:00 committed by GitHub
commit 66894b6b27
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -85,11 +85,8 @@ module Homebrew
def info
info_args.parse
if args.json
if args.json == "v1" || args.json == true
raise UsageError, "invalid JSON version: #{args.json}" unless ["v1", true].include? args.json
print_json
else
raise UsageError, "invalid JSON version: #{args.json}"
end
elsif args.github?
exec_browser(*ARGV.formulae.map { |f| github_info(f) })
else