outdated: Rename --formula-only and --cask-only to --formula and --cask
For consistency with brew --cache
This commit is contained in:
parent
ee0e9945e0
commit
d81296f8dc
@ -33,9 +33,9 @@ module Homebrew
|
|||||||
"updates when a new stable or development version has been released."
|
"updates when a new stable or development version has been released."
|
||||||
switch "--greedy",
|
switch "--greedy",
|
||||||
description: "Print outdated casks with `auto_updates` or `version :latest`"
|
description: "Print outdated casks with `auto_updates` or `version :latest`"
|
||||||
switch "--formula-only",
|
switch "--formula",
|
||||||
description: "Treat all arguments as formulae"
|
description: "Treat all arguments as formulae"
|
||||||
switch "--cask-only",
|
switch "--cask",
|
||||||
description: "Treat all arguments as casks"
|
description: "Treat all arguments as casks"
|
||||||
switch :debug
|
switch :debug
|
||||||
conflicts "--quiet", "--verbose", "--json"
|
conflicts "--quiet", "--verbose", "--json"
|
||||||
@ -46,19 +46,18 @@ module Homebrew
|
|||||||
def outdated
|
def outdated
|
||||||
outdated_args.parse
|
outdated_args.parse
|
||||||
|
|
||||||
|
formula_only = args.formula?
|
||||||
if args.json
|
if args.json
|
||||||
raise UsageError, "invalid JSON version: #{args.json}" unless ["v1", true].include? args.json
|
raise UsageError, "invalid JSON version: #{args.json}" unless ["v1", true].include? args.json
|
||||||
|
|
||||||
# When user asks for json, print json for formula only unless the user explicitly asks for casks
|
# When user asks for json, print json for formula only unless the user explicitly asks for casks
|
||||||
formula_only = !args.cask_only?
|
formula_only = !args.cask?
|
||||||
else
|
|
||||||
formula_only = args.formula_only?
|
|
||||||
end
|
end
|
||||||
|
|
||||||
if formula_only
|
if formula_only
|
||||||
formulae = args.resolved_formulae.blank? ? Formula.installed : args.resolved_formulae
|
formulae = args.resolved_formulae.blank? ? Formula.installed : args.resolved_formulae
|
||||||
outdated = print_outdated_formulae(formulae)
|
outdated = print_outdated_formulae(formulae)
|
||||||
elsif args.cask_only?
|
elsif args.cask?
|
||||||
casks = args.named.blank? ? Cask::Caskroom.casks : args.named
|
casks = args.named.blank? ? Cask::Caskroom.casks : args.named
|
||||||
outdated = print_outdated_casks(casks)
|
outdated = print_outdated_casks(casks)
|
||||||
else
|
else
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user