Skip to content

Commit

Permalink
Merge pull request #22031 from reitermarkus/cask-list-individual-argu…
Browse files Browse the repository at this point in the history
…ments

Check arguments individually in `brew cask list`.
  • Loading branch information
claui authored Jun 16, 2016
2 parents 2b57795 + d6cb399 commit 6c20092
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
18 changes: 11 additions & 7 deletions lib/hbc/cli/list.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,17 @@ def self.list_casks(*cask_tokens)
count = 0
cask_tokens.each do |cask_token|
odebug "Listing files for Cask #{cask_token}"
cask = Hbc.load(cask_token)
if cask.installed?
count += 1
list_artifacts(cask)
list_files(cask)
else
opoo "#{cask} is not installed"
begin
cask = Hbc.load(cask_token)
if cask.installed?
count += 1
list_artifacts(cask)
list_files(cask)
else
opoo "#{cask} is not installed"
end
rescue Hbc::CaskUnavailableError => e
onoe e
end
end
count == 0 ? nil : count == cask_tokens.length
Expand Down
1 change: 1 addition & 0 deletions lib/hbc/source.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ def self.sources

def self.for_query(query)
odebug "Translating '#{query}' into a valid Cask source"
raise Hbc::CaskUnavailableError.new(query) if query.to_s =~ /^\s*$/
source = sources.find do |s|
odebug "Testing source class #{s}"
s.me?(query)
Expand Down

0 comments on commit 6c20092

Please sign in to comment.