diff options
| author | Markus Reiter | 2017-09-17 04:03:56 +0200 |
|---|---|---|
| committer | GitHub | 2017-09-17 04:03:56 +0200 |
| commit | dbc4a385b9d421b1738c86b4d0ca7cc1b49b3782 (patch) | |
| tree | 2f4ddf25d1b098075efd023045c92e1faadc4d78 /Library/Homebrew/cask/lib | |
| parent | e537db28cb6b961deab28dc7487887dfe1e659cf (diff) | |
| parent | acf1b278ae0c27f19e7d20a9d23c005201dc818c (diff) | |
| download | brew-dbc4a385b9d421b1738c86b4d0ca7cc1b49b3782.tar.bz2 | |
Merge pull request #2878 from wendorf/brew_cask_list_full-name
List cask full-names
Diffstat (limited to 'Library/Homebrew/cask/lib')
| -rw-r--r-- | Library/Homebrew/cask/lib/hbc/cask.rb | 8 | ||||
| -rw-r--r-- | Library/Homebrew/cask/lib/hbc/cli/list.rb | 3 |
2 files changed, 11 insertions, 0 deletions
diff --git a/Library/Homebrew/cask/lib/hbc/cask.rb b/Library/Homebrew/cask/lib/hbc/cask.rb index 27f8ae791..72a23066f 100644 --- a/Library/Homebrew/cask/lib/hbc/cask.rb +++ b/Library/Homebrew/cask/lib/hbc/cask.rb @@ -41,6 +41,14 @@ module Hbc .reverse end + def full_name + if @tap.nil? || @tap == Hbc.default_tap + token + else + "#{@tap}/#{token}" + end + end + def installed? !versions.empty? end diff --git a/Library/Homebrew/cask/lib/hbc/cli/list.rb b/Library/Homebrew/cask/lib/hbc/cli/list.rb index faa1160a1..32415af8a 100644 --- a/Library/Homebrew/cask/lib/hbc/cli/list.rb +++ b/Library/Homebrew/cask/lib/hbc/cli/list.rb @@ -3,6 +3,7 @@ module Hbc class List < AbstractCommand option "-1", :one, false option "--versions", :versions, false + option "--full-name", :full_name, false option "-l", (lambda do |*| one = true # rubocop:disable Lint/UselessAssignment @@ -42,6 +43,8 @@ module Hbc puts installed_casks.map(&:to_s) elsif versions? puts installed_casks.map(&self.class.method(:format_versioned)) + elsif full_name? + puts installed_casks.map(&:full_name).sort &tap_and_name_comparison elsif !installed_casks.empty? puts Formatter.columns(installed_casks.map(&:to_s)) end |
