Skip to content

Commit

Permalink
Merge pull request #1157 from phinze/prefpanes
Browse files Browse the repository at this point in the history
Tweaks to preference panes in response to feedback
  • Loading branch information
phinze committed Oct 8, 2013
2 parents 7a99af1 + 18fb8fc commit 6083a02
Show file tree
Hide file tree
Showing 12 changed files with 18 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/cask/cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,10 @@ def self.nice_listing(cask_list)
def self.parser
@parser ||= OptionParser.new do |opts|
opts.on("--appdir=MANDATORY") do |v|
Cask.appdir = Pathname.new File.expand_path(v)
Cask.appdir = Pathname(v).expand_path
end
opts.on("--prefpanedir=MANDATORY") do |v|
Cask.prefpanedir = Pathname(v).expand_path
end
end
end
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
14 changes: 14 additions & 0 deletions test/cli/options_test.rb → test/cask/cli/options_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,20 @@
Cask.appdir.must_equal Pathname('/some/path/bar')
end

it "supports setting the prefpanedir" do
Cask::CLI.process_options %w{help --prefpanedir=/some/path/foo}

Cask.prefpanedir.must_equal Pathname('/some/path/foo')
end

it "supports setting the prefpanedir from ENV" do
ENV['HOMEBREW_CASK_OPTS'] = "--prefpanedir=/some/path/bar"

Cask::CLI.process_options %w{help}

Cask.prefpanedir.must_equal Pathname('/some/path/bar')
end

it "allows additional options to be passed through" do
rest = Cask::CLI.process_options %w{edit foo --create --appdir=/some/path/qux}

Expand Down
File renamed without changes.
File renamed without changes.

0 comments on commit 6083a02

Please sign in to comment.